views:

14

answers:

0

Hi...

I'm developing a mozilla Add-on, and i would like to know, how to change a page that is requested by ajax before the response be sent..

Let's say that in stackoverflow i have a button and when i click call this function:

h = new XMLHttpRequest();
 h.open("GET", "somepage",true);
 h.onreadystatechange=function() {
  if (h.readyState==4) {
   alert(h.responseText); //I want change this result before the javacript alert the content...
  }
 }
 h.send(null)

I hope you understand my question... the site which a want to change works all with ajax, and i didn't find another way to change the content without change the response in ajax.

Thanks :)