2011-10-18 53 views

回答

1

重寫XHR對象的原型,例如:

//Capture the original XHR.open method 
var _XMLHTTPRequest_open = XMLHttpRequest.prototype.open; 

//Overwrite the XHR.open method 
XMLHttpRequest.prototype.open = function(){ 
    //Do something, checks, etc. 
    //If permitted: 
    _XMLHTTPRequest_open.apply(this, arguments); 
}