如何使用jQuery明确制作AJAX HTTPS GET请求?我正在尝试做以下事情。 在HTTPS页面中,我与代码$.get("/resource")
一条线,但我得到以下错误如何使用jQuery制作AJAX HTTPS GET请求
XMLHttpRequest cannot load http://www.site.com/resource. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.site.com' is therefore not allowed access.
为什么AJAX调用试图通过HTTP协议访问的网页,如果相对资源是从HTTPS页?如果$ .get(url)方法默认执行此操作,那么如何使用jQuery执行明确的HTTPS GET请求?另一位遇到类似问题的人在http://forum.jquery.com/topic/jquery-get-ajax-call-on-http-page-to-https-on-same-domain无法解决问题。
jQuery的版本是1.7.2
参见:http://stackoverflow.com/questions/15375908/ajax-get-request-over -https – klugerama
@FearlessFuture - 你是否从同一个域获取GET? – avijendr
另外:http://stackoverflow.com/questions/7311702/will-jquery-ajax-without-full-url-remain-https-if-original-page-load-was-https – klugerama