Reputation: 131
I have a popup window which after opening makes several initialization ajax calls.
In all browsers this works perfectly fine, except IE (standard state of affairs).
In IE (7,8) sometimes (most of the time it works, however once it breaks it starts to break most of the time) the ajax requests do not appear to actually send. The 'beforeSend' event is firing ok but that's the end of it. The server never receives the request, the complete/success/error events for the ajax request are never fired.
Is this a known problem or has anyone else experienced this? Kind of grasping at straws here ...
It seems to happen mostly if I open multiple (of the same) popups, close them, open some more and just keep doing that eventually it will fail.
The ajax requests are a mix of PUTs and GETS using syntax like:
$.ajax({
type: 'GET',
url: uri,
cache: false,
dataType: "json",
beforeSend: function(obj) { ... logging ... },
...etc... });
Upvotes: 2
Views: 1055
Reputation: 525
I was having the same symptoms, AJAX worked fine in everything except IE.
Turn out I hadn't specified the AJAX url in my PHP (schoolboy error) so I had...
$.ajax({
type: "POST",
url: "",
data: postData ,
etc. etc.
Seems other browsers treat "" as a request to send the AJAX call to the current URL, but IE just refuses to send the request full stop. Perhaps it thinks it's a cross domain request or something.
Anyway, putting the URL in made it work!
Upvotes: 0
Reputation: 878
I had this exact issue, turned out it was my console.log statements were causing IE AJAX calls to hang, commented out all the console.log statements and it worked.
Upvotes: 6
Reputation: 2023
You might want to try to use ajaxMonitor. It is easy to add this jQuery plug-in to monitor your Ajax requests to your server.
Upvotes: 0