Firefox addon Firefox插件-读取传入的xhr响应
是否可以使用Firefox插件从特定的web地址读取传入的xhr响应?Firefox addon Firefox插件-读取传入的xhr响应,firefox-addon,Firefox Addon,是否可以使用Firefox插件从特定的web地址读取传入的xhr响应? 如果可能的话,我怎么做呢?假设您发送了请求,您只需要分配一个回调函数。在本例中,processResponse将接收结果 function processResponse(xhr){ console.log("\nRESPONSE of " + xhr.responseText.length + " characters.\n"); console.log(xhr.responseText); } var xhr
如果可能的话,我怎么做呢?假设您发送了请求,您只需要分配一个回调函数。在本例中,processResponse将接收结果
function processResponse(xhr){
console.log("\nRESPONSE of " + xhr.responseText.length + " characters.\n");
console.log(xhr.responseText);
}
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
processResponse(xhr);
}
}
xhr.open ("post", "myphp.php", true);
var somePostData = "&command=print";
xhr.send (somePostData);