I have a very special problem with jQuery ajax requests.
when a user is browsig various parts of the webpage, there are jquery get() calls to fetch some content.
The thing is that those requests stop working on random occasions.
When I check the request response in firebug, the request status is 200 OK, but the firebug request is colored as red as in there was an error, but there is no error message.
The response tab in firebug is empty.
The thing is that is I visit those urls normally, not thought ajax, the content is returned normally.
So if I restart the browser it’s all good again,
I’m using jquery 1.7.1 and jquery.effects.core.js
Here’s where I make the request:
$.get('abc', function(data) {
...
}).error(function(xhr, status, error) { alert("An AJAX error occured: " + status + "\nError: " + error);});
The alert gets called when the problem occurs and the ‘status’ variable has value of ‘error’ and the ‘error’ variable is an empty string…
I really have no idea what could the problem. Some help would be appreciated
Remember to always catch errors and report them so you can find the problem without guessing what it may be:
This checks to make sure that
console.logexists and is a function before trying to use it. Ifconsole.logexists then this will log the all the error information associated with the AJAX request.Docs: http://api.jquery.com/jquery.ajax