简体   繁体   中英

Is it posible making a cross-domain request from a https-site to a http-site?

I am trying to add a view-counter for my own hexo blog which is hosted on github. my blog I have made a counter app on SAE. But when i add my JavaScript code on my blog(https) to use the counter(http), cross-domain error come out. Besides, when i use http to visit my blog, it seems allright. JavaScript code like this: $.ajax({ type:get, url:xxxxx, success:function(msg){ writeDom(msg); } })

Besides, I have add header("Access-Control-Allow-Origin: *"); in my counter in SAE. if it posible, what can i do? You can hit F12 in Chrome to see the error. But if you visit my site with http, there is no error anymore.

No, by default modern browsers do not support this for security reasons. You can manually disable this when you run Chrome, but that's obviously not a scalable solution.

use

https://lizterminator.sinaapp.com/ ; SAE support https request.

or

Just use http to visit your blog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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