I'm currently working on a purely HTML and JavaScript driven web app that uses CORS for consuming a remote web service but currently having trouble with IE 11 making a GET request. The funny thing is we've got it working fine in IE8/9/10 just not 11.
The problem is that IE 11 appears to timeout and not wait for a response from the server. The ajax call is simply:
$.ajax(url, {
dataType: 'json',
complete: complete,
type: 'GET',
global: true,
success: success,
crossDomain: true,
xhrFields: {
withCredentials: true
}
});
In the network tab and using Fiddler I can see IE never even sends the request.
Does anyone have any ideas please?
EDIT: I forgot to mention I've already tried cache: false. I've also found something very strange in that if I switch document mode in dev tools from Edge to 9 then back again the call works everytime, even after I've cleared IE and restarted it, whether cache is true or false. Very bizarre. :\
Uses this in your in head tag
If you are running local, try switching crossDomain to false. I spent quite a bit of time stuck on that. Chrome handled the crossDomain, but in IE if you are not using crossDomain and you have it set to true it will silently fail.
IE is famous for caching. Make sure you are not getting a cached response. You can either set the
cache
property value tofalse
or add a unique timestamp to the url so that it will not be a cached response. You may use the$.now()
method to get a unique timestamp.Setting the cache property
Adding a unique timestamp to URL
The
$.now()
method is a shorthand for the number returned by the expression(new Date).getTime()
I know this thread is old, but just as an extra check for those that encounter this issue, check that your Trusted Sites Zone settings allow access across domains. The first setting under "Miscellaneous" is the setting you want.
Set "Access data sources across domains" to "Enable".
i'm not sure, maybe it's caching, try to set property "cache: false"
otherwise, you can also try add a datetime at the end of your url, so you have everytime a different url and IE won't cache