简单的 jQuery 代码可以正常工作,直到通过 https://加载站点 [英] Simple jQuery code works fine until site is loaded via https://

查看:19
本文介绍了简单的 jQuery 代码可以正常工作,直到通过 https://加载站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 jQuery 代码,用于提交表单并隐藏/显示一些屏幕信息.它在测试时工作正常,直到通过 https://加载它在 IE7 中中断.它似乎完全中断,脚本没有任何效果.我还收到 IE 警告,提示某些元素不安全".

I have a simple peice of jQuery code that submits a form and hides/shows some on screen information. It works fine when tested, until loaded via https:// upon which it breaks in IE7. It appears to break totally, with none of the script having any effect. I also get the IE warning that "some elements are insecure".

有没有人遇到过这种情况?或者更好的是,一个解决方案!我必须通过 https 加载页面作为信用卡支付页面.

Does anyone have any experience of this happening? Or even better, a solution! I have to load the page via https as its a credit card payment page.

推荐答案

前三个答案都提到了安全的https"页面试图包含来自http"的脚本或其他资源(样式表、图像等)的问题" 路径...

The three previous answers all mention the problem of a secured "https" page trying to include scripts or other resources (stylesheets, images, etc) from an "http" path...

我想补充这些,并注意如果您遇到可以通过 http 或 https 加载相同页面的情况,那么您可以创建无协议"URL--- 协议将被假定为与当前页面相同.请注意,这仅用于访问不同域上的资源(并且仅当这些不同的域同时支持 http 和 https 时才有效),因为显然如果您正在访问同一域上的资源,则不需要以 http 开头://完全...

I would like to add to these, and note that if you have a situation where the same pages could be loaded via either http or https, then you can create "protocol-less" URLs---the protocol will be assumed to be the same as the current page. Note this is only needed for accessing resources on different domains (and will only work if those different domains support both http and https), because obviously if you're accessing resources on the same domain, you don't need to start with http:// at all...

例如,根据当前页面的访问方式,这三个资源中的每一个都将假定为 http 或 https:

For example, each of these three resources would assume either http or https depending on how the current page was accessed:

<script src="//www.example.com/whatever.js" type="text/javascript"></script>
<img src="//www.example.com/someimage.png" alt="whatever" />
<link href="//www.example.com/styles.css" rel="stylesheet" />

这篇关于简单的 jQuery 代码可以正常工作,直到通过 https://加载站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆