【发布时间】:2013-01-16 20:06:20
【问题描述】:
我有一个位于不同服务器中的 javascript 文件,我将 javascript 文件包含在 http 页面上,例如
<script type="text/javascript" src="http://www.example.com/scriptfile.js">
或超过https页面喜欢
<script type="text/javascript" src="https://www.example.com/scriptfile.js">
问题是,我的页面从http 切换到https,例如,如果用户在
http://www.example.com/home(站点主页 URL),我通过 http 加载 javascript,现在当用户导航到另一个页面,如 https://www.example.com/transaction(站点事务 URL)时,我通过 https 加载脚本及其工作美好的。如果用户点击https://www.example.com/home(主页URL 更改为https),则从提到的事务URL 中,我通过http 加载的脚本由于内容不安全而失败。欢迎提出任何处理此问题的建议。
【问题讨论】:
-
简单的解决方案是删除所有不安全的内容 - 只需在整个站点中使用 https://,然后关闭端口 80。
-
@Floris 无论页面协议如何,我都使用“https”加载了 javascript,它运行良好。谢谢。
标签: javascript html https internet-explorer-8