diff options
author | Marian Oancea <contact@siteshop.ro> | 2014-11-06 01:46:01 +0800 |
---|---|---|
committer | Marian Oancea <contact@siteshop.ro> | 2014-11-06 01:46:01 +0800 |
commit | 4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c (patch) | |
tree | c368675984eb642f13334f2e61f6401d58776863 /lib/browser_fix | |
parent | 3e174a08790ca009a2107a3564b179ae1f036c33 (diff) | |
download | go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.gz go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.bz2 go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.lz go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.xz go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.zst go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.zip |
Converted to node module
Converted to npm package
Added brower
Added browserify with minification
Updated Readme
Diffstat (limited to 'lib/browser_fix')
-rw-r--r-- | lib/browser_fix/xhr.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/browser_fix/xhr.js b/lib/browser_fix/xhr.js new file mode 100644 index 000000000..aeb9bfaf7 --- /dev/null +++ b/lib/browser_fix/xhr.js @@ -0,0 +1,35 @@ + +/** + * 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; |