Archive for the ‘FireFox’ Category

FireFox bug with onreadystatechange

Saturday, May 24th, 2008

Just ran into this bug in FireFox: Basically, if you do a synchronous call on an XMLHttpRequest object, the onreadystatechange function is not called. So the following code doesn’t work.

var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState == 4)
  if (request.status == 200) alert('request successful')
};"GET", "/index.html", false); /* the false here makes it synchronous *