从https发送和接收信息

时间:2021-12-24 07:39:12

Sorry if this sounds stupid but I really am over my head here. At work I have made a website and another guy at my work has made a webserver. My website is https, and I have found I can reach my website by typing "https://myurl or http://myurl

对不起,如果这听起来很愚蠢,但我真的在这里。在工作中我创建了一个网站,而我工作的另一个人已经建立了一个网络服务器。我的网站是https,我发现我可以通过输入“https:// myurl或http:// myurl”来访问我的网站

In my website I make a call to the webserver that looks like this...

在我的网站上,我打电话给看起来像这样的网络服务器......

$.ajax({
 crossDomain:true,
 contentType:"application/json; charset=utf-8",
 type:"POST",
 url: 'http://urlOfWebserver/'+data.method,
 dataType:"jsonp",
 data: data.data,
 success: function (data){}

When i am at my site with http everything works, but when I am on my site with the https prefix i get the following error

当我在我的网站上http一切正常,但当我在我的网站上使用https前缀时,我得到以下错误

Mixed Content: The page at 'https://myurl' was loaded over HTTPS, but requested an insecure script 'http://urlOfWebserver/MQueryString. This request has been blocked; the content must be served over HTTPS.

混合内容:'https:// myurl'页面是通过HTTPS加载的,但请求了一个不安全的脚本'http:// urlOfWebserver / MQueryString。此请求已被阻止;内容必须通过HTTPS提供。

Can this issue be fixed from my website or does it need to be fixed on the webserver?

可以从我的网站修复此问题,还是需要在网络服务器上修复?

1 个解决方案

#1


0  

Here is a link for documentation about CORS can help you https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

以下是有关CORS文档的链接可以帮助您https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

#1


0  

Here is a link for documentation about CORS can help you https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

以下是有关CORS文档的链接可以帮助您https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS