indexOf(“http”)在http和https上匹配
indexOf("http") matches on http and https
我有以下代码,
var protocol = jQuery('script[src*="kaltura"]').attr("src");
protocol.toLowerCase().indexOf("http");
问题是indexOf
在http和https上匹配。我如何才能只在http上匹配它?
假设您只想检查网站的协议,请检查http://
:
protocol.toLowerCase().indexOf("http://");
相关文章:
- web配置http到https重定向异常
- HTML:从http到https发布表单
- 维护https和http之间的私钥
- 组合Bookmarklets以在HTTP和HTTPS之间创建切换
- 调用 http url 有效,但 Https 不起作用
- 当服务器从 http 更改为 https 时,有哪些可能的方法可以解决问题
- HTTP 或 HTTPS 根据当前连接
- 如何在 http:// 页面中加载登录 https:// 页面
- Firefox扩展不适用于http://https://以外的URL
- HTML/JavaScript - 带有自动 http/https 前缀的远程 img src
- 替换 Base64 - http/https 通信是否 8 位干净
- 想要在我的 GWT 应用程序 (Java 7) 中为每个 http/https 超链接添加锚 html 标记
- Facebook http / Https error
- http/https与网站上的linkedin推荐不匹配
- 验证URL(如果用户使用http:// https:// www)
- Safari和Chrome之间的http / https引用
- 为正则表达式增加http/https检查
- Variable HTTP/HTTPS Express Server
- 在Javascript中使用//www.example.com是否自动选择了http/https协议
- mikeal's请求与Node.js中http/https模块的比较