forked from cerc-io/plugeth
4be4db5e6c
Converted to npm package Added brower Added browserify with minification Updated Readme
36 lines
553 B
JavaScript
36 lines
553 B
JavaScript
|
|
/**
|
|
* Module dependencies.
|
|
*/
|
|
|
|
var global = (function() { return this; })(); // jshint ignore:line
|
|
|
|
/**
|
|
* XMLHttpRequest constructor.
|
|
*/
|
|
|
|
var XMLHttpRequest = window.XMLHttpRequest; // jshint ignore:line
|
|
|
|
/**
|
|
* Module exports.
|
|
*/
|
|
|
|
module.exports.XMLHttpRequest = XMLHttpRequest ? xhr : null;
|
|
|
|
/**
|
|
* XMLHttpRequest constructor.
|
|
*
|
|
* @param {Object) opts (optional)
|
|
* @api public
|
|
*/
|
|
|
|
function xhr(obj) {
|
|
var instance;
|
|
|
|
instance = new XMLHttpRequest(obj);
|
|
|
|
return instance;
|
|
}
|
|
|
|
if (XMLHttpRequest) xhr.prototype = XMLHttpRequest.prototype;
|