views:

152

answers:

1

Problem:

  • I am looking for a way to intercept xhr.open() calls
  • I am writing a framework which will run along side exiting code, over which i have no control
  • I need to intercept the open calls in this existing code.
  • I cannot change the existing code
  • I must thus override the native XHR implementation for both IE and Firefox.

I have made the following progress: http://dogself.com/telluriumTest/scripts/xhrhook.js

the above hook works in firefox, but does not bind onreadystatechange properly in IE, so the request is made, but the onreadystatechange callback never executes correctly.

Can you give me any new ideas on how to approach this problem?

A: 

I guess XMLHttpRequest.js is exactly what you need, no?

Sergey Ilinsky
yes, it is. you have no idea how long ive looked for this. i wish i could vote you up more then once.. hmmm.
mkoryak
If you have any further questions regarding the tiny library, do not hesitate contacting me - by an occasion I am the author ;)
Sergey Ilinsky
yeah i noticed that. im glad you wrote that. im going to use your lib on this project:http://code.google.com/p/aost/issues/detail?id=145you should stop by there, we are always looking for strong JS talent
mkoryak