$ gnpm install xhr-response
The xhr-response
is a small helper library for safely extracting response data
from XHR requests. There are some minor bugs in browsers which can cause
exceptions to be thrown when accessing the wrong properties of an XHR request
instance. This module works around these bugs.
This module is primary written for client-side code which use the commonjs module pattern for exporting.
npm install --save xhr-response
It's just as simple as:
var response = require("xhr-response");
var xhr = new XMLHTTPRequest();
// .. stuffs ..
xhr.onload = function () {
var data = response(xhr);
console.log('data', data);
};
MIT
Copyright 2013 - present © cnpmjs.org | Home |