browser-get
v0.2.0 browser-get browserify get xmlhttprequest ajax promise
browser-get
IE8+ compatible GET requests for the browser. Includes an ES6 promise polyfill.
Installation
Grab the dist/browser-get.js
file and include it at the bottom of your page:
<script src="browser-get.js"></script>
Or use Browserify:
npm install browser-get --save
var get = require('browser-get');
Usage
// Returns an ES6 promise.
var promise = get('foo/bar/something-or-other.whatever');
// When request completes.
promise.then(function( resp ){
console.log( resp );
});
// If request fails.
promise.catch(function( resp ){
console.log( resp );
});
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
License
Copyright (c) 2014 Chris Contolini
Licensed under the MIT license.