Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
192
rated 0 times [  195] [ 3]  / answers: 1 / hits: 53718  / 11 Years ago, wed, march 13, 2013, 12:00:00

How can I send an ajax GET request over HTTPS?



$.get throws this:



XMLHttpRequest cannot load https://********. Origin null is not allowed by Access-Control-Allow-Origin. 


Is there another way or some workaround to get this working?



If I navigate to the url with Chrome I'm able to get the response. I see no reason why it shouldn't work work over an ajax request.


More From » ajax

 Answers
11

You cannot make an AJAX request to an https page if you are currently in http because of the Same Origin Policy.



The host, port and scheme (protocol) must be the same in order for the AJAX request to work.



You can either make sure that the originating page is on the same host and scheme or implement CORS (cross-origin resource sharing) on the target domain to permit this particular request.


[#79629] Tuesday, March 12, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaelyn

Total Points: 619
Total Questions: 102
Total Answers: 104

Location: Honduras
Member since Sun, Dec 26, 2021
2 Years ago
;