What can cause XMLHttpRequest to never change state in Firefox?

I am working on old AJAX code written in the dark dark days before jQuery. Oddly enough, he has worked perfectly for many years, until today, when he suddenly stopped shooting with his callback. Here is the basic code:

var xml = new XMLHttpRequest();  // only needs to support Firefox
xml.open("GET", myRequestURL, true);
xml.onreadystatechange = function() { alert ('test'); };
xml.send(null);

Checking the Firebug console, the request is sent without any problems, and it gets the correct XML from the request URL, but the function onreadystatechangedoes not work at all. There are no javascript errors or anything else strange in the system.

I'm sorry that I can't just rewrite everything using jQuery, but now I don't have time. What could be causing this problem?


Further update - I was able to test my code in another browser (FFx 3.0) and it worked there, so this is a problem with my browser. I am running Firefox 3.5b4 on Vista, and I tried it now when all my add-ons are disabled without any luck. This still bothered me a lot because yesterday I was working on this site (with the same browser setting) and there were no problems at all ...

In fact, I just looked around in the Addons window and saw that Firebug was still on. If I disable Firebug, it works fine. If I turn it on, it will break. Firebug version 1.40.a31

+5
source share
3 answers

- wrong code? you tried to shift all this to an attempt and warn about errors (if any)

? url http-auth? ( ), )

:

. firefox 3.5 beta4? firefox . firebug, ajax, , script ccreating . firebug, ( , )... , .

firebug (, , "Net" )

+4

It seems unlikely that onreadystatechange will stop working. Is it possible that the warning function is somehow disabled or overridden? Can you replace the warning with some code to make a visible change on the page and test its functionality in this way? (I know its a stretch, but it seems strange that onreadystatechange does not work!)

0
source

All Articles