Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  passing parameters to XMLHttpRequest’s onreadystatechange function

I’ve been smashing my head against this all day – but I finally got something working consistently and reliable, so I better damn well document it. This is as good a place as any, and hopefully it will be useful to others.I needed to make an Ajax call, so I turned to my good friend XMLHttpRequest. One wrinkle was that I needed to pass in a parameter to it… so I tried:var test = "bar";req = new XMLHttpRequest();req.open("GET", myURL, true);req.foo = test;req.onreadystatechange = function() { if (this.readyState != 4) return; if (this.status == 200) { aler...

13,073 1       AJAX JAVASCRIPT XMLHTTPREQUEST PARAMETER ONREADYSTATECHANGE