views:

36

answers:

2

I need the way to intercept all ajax requests maded from page. So i need some wrapper to add my data to all users requests.

A: 

I dont think you can get this out of the box .
What you need here is a little restructuring of your client side code [ You should have already done that , but it is never too late :) ] .
Make a function that has the responsibility of interacting with server . Use this to make ALL your server requests and get data . After that whenever you need to do something at a application level ( like maybe caching data to avoid server side trip ) you can do in this function .
So something like

xhr_request( url , callback_function, params ) ;
// where xhr_request is your custom function that takes care of server interaction .
NM
But i get it) You can look at it here: http://gist.github.com/469941
Creotiv
+1  A: 

Huh... i made this work))) with help of this topic Extending an ActiveXObject in javascript i made script that intercept all ajax requests no matter what framework or browser do user use.

You can look at it here: Script

Creotiv