Ajax Silently Failing in HTTPS but fine in HTTP

This is post is now quite old and the the information it contains may be out of date or innacurate.

If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub

If you are struggling to debug why some ajax, perhaps using jquery etc is working fine when you access the page via http, but if you use https then it fails silently with very little error messaging to work on then this could be your solution.

Basically, although you have accessed the page over HTTPS, if there are any insecure elements on the page then your ajax call will default to http and will then fail silently thanks to cross domain policy problems.

If you debug in chrome, you do get a meaningful error message but if like me you generally prefer working in Firefox and Firebug then you are up the creek.

Double check your source code for http:// and also check out live http headers for insecure calls.


Tags: javascriptpostgetssljqueryhttpsfailsilently