javascript 从 HTTPS 页面到 HTTP Url 的 AJAX 请求

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14703549/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 22:21:11  来源:igfitidea点击:

AJAX Request From HTTPS Page to HTTP Url

javascriptajaxhttphttpscors

提问by Kassem

I have a case where I need to perform an AJAX request from an HTTPS page to another one (on a different domain) that is not secure. We've already implemented CORS policy and it was working fine before using HTTPS on our website. Is there any way to make this work?

我有一个案例,我需要从 HTTPS 页面到另一个不安全的页面(在不同的域上)执行 AJAX 请求。我们已经实施了 CORS 政策,并且在我们的网站上使用 HTTPS 之前它运行良好。有什么办法可以使这项工作?

采纳答案by Mitchell

According to W3, it's not possible through a COR policy due to "certificate errors" http://www.w3.org/TR/access-control/#user-agent-security

根据 W3 的说法,由于“证书错误”,无法通过 COR 策略 http://www.w3.org/TR/access-control/#user-agent-security