In firefox, when javascript tries to execute a CORS request to the http server from a page hosted on https , this will cause an error:
Blocked loading mixed active content
I would like to catch these errors, but I cannot figure out how to do this. For example, I tried something like this with jQuery:
try { $.get("http://public.opencpu.org/ocpu/library/").fail(function(xhr, err){ console.log("Server error:" + xhr.responseText); }); } catch(e){ console.log(e.message);; }
But xhr.responseText and e.message are empty lines (perhaps because $.ajax happens asynchronously). How can I catch the actual error message that says: Blocked loading of mixed active content ...
javascript jquery firefox ajax cors
Jeroen
source share