I'm trying to make a HTTP GET
request in javascript to a rest API from within an iframe
.
The iframe is sandboxed, but it has the allow-scripts
attribute set, and the API I'm calling is enabled to allow all origins, so CORS shouldn't be a problem.
I've recreated the scenario with a minimal code sample here:
http://plnkr.co/edit/jrchvxFXQQDqs2Fv
If you go to that page and preview the page with any modern browser (Chrome, Edge, etc.) it works correctly.
But if you do that with Internet Explorer 11
, the call fails. On the javascript console, we get this generic network error:
but the weird thing is: the call is actually running correctly. In fact, if we check the network tab, we can see it being performed and returming 200:
Am I doing something wrong here, or is this just the usual IE being IE?