jQuery的阿贾克斯后,以非SSL页面,而当前页是SSL前页、而当、页面、jQuery

由网友(痞子爱人)分享简介:好了,形势:在一个HTTPS / SSL页面的jQuery 表格通过AJAX到非SSL pagge提交没有得到有用的回应相同的情况下,非SSL到非SSL运行完美。the same scenario, non-ssl to non-ssl works perfect.我可以查看我的控制台,但为什么请求失败不能...

好了,形势:

在一个HTTPS / SSL页面 的jQuery 表格 通过AJAX到非SSL pagge提交

没有得到有用的回应

相同的情况下,非SSL到非SSL运行完美。

the same scenario, non-ssl to non-ssl works perfect.

我可以查看我的控制台,但为什么请求失败不能得到任何有用的信息从它...

I can view my console, but cant get any usefull info from it why the request fails...

$.ajax({

type: "POST",
url: form.attr("action"),
data: form.serialize(),

error: 			function(res){ console.log(res) },
notmodified: 	function(res){ console.log(res) },
parsererror: 	function(res){ console.log(res) },
timeout: 		function(res){ console.log(res) },
success: 		function(res){ alert('succes!'); }

});

推荐答案

您将无法从非SSL页面给SSL URL AJAX调用。这违反了SOP(同源策略),因为协议(HTTP VS HTTPS)是不同的。一些旧的浏览器没有这个限制,但所有新的强制执行此了。

You can't make AJAX calls from non-SSL page to a SSL URL. This violates the SOP (Same Origin Policy) because the protocols (HTTP vs HTTPS) are different. Some old browsers don't have this restrictions but all new ones enforce this now.

阅读这篇文章,了解更多详情,

Read this article for more details,

的http:// code.google.com / P /谷歌网页工具包-DOC-1-5 /维基/ FAQ_SOP

阅读全文

相关推荐

最新文章