简体   繁体   English

如何使用jquery从HTTP到HTTPS WS进行Ajax调用

[英]How to make ajax calls from HTTP to HTTPS WS using jquery

Some of my Web services are in https but my home page is in http how can i make ajax calls to get that secure data. 我的某些Web服务在https中,但我的主页在http中,我如何进行ajax调用以获取该安全数据。 Now i am trying using cURL in the php page. 现在,我正在尝试在php页面中使用cURL。 Is there any other option to get using jquery 1.5 还有其他选择可以使用jQuery 1.5

The simplest and obvious answer is to make your page https as well. 最简单,最明显的答案就是也将您的页面设为https。 But thats usually not feasible so, you need to use jsonp to circumvent the Same Origin Policy . 但这通常是不可行的,因此,您需要使用jsonp绕过Same Origin策略 You can learn more about jsonp here 您可以在此处了解有关jsonp的更多信息

您可以使用对本地域的HTTP代理调用包装它,然后从服务器向HTTPS发出cURL请求。

Some code provided might help. 提供的一些代码可能会有所帮助。 But should be simply a case of providing the full https://www.yoursite.com url to your ajax scripts. 但是,仅应为您的ajax脚本提供完整的https://www.yoursite.com网址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM