xhr-response
Safely extract the XHR response from your XHR instance.
Last updated 10 years ago by 3rdeden .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install xhr-response 
SYNC missed versions from official npm registry.

xhr-response

Made by unshiftVersion npmBuild StatusDependenciesCoverage StatusIRC channel

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.

Installation

This module is primary written for client-side code which use the commonjs module pattern for exporting.

npm install --save xhr-response

Usage

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);
};

License

MIT

Current Tags

  • 1.0.1                                ...           latest (10 years ago)

2 Versions

  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |