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

查看:771
本文介绍了简单的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天全站免登陆