Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gagan-bansal/get-json-data
Make ajax request to get the json data.
https://github.com/gagan-bansal/get-json-data
ajax get json
Last synced: about 5 hours ago
JSON representation
Make ajax request to get the json data.
- Host: GitHub
- URL: https://github.com/gagan-bansal/get-json-data
- Owner: gagan-bansal
- License: mit
- Created: 2014-12-24T11:04:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-22T07:03:38.000Z (over 8 years ago)
- Last Synced: 2024-11-10T03:27:28.293Z (7 days ago)
- Topics: ajax, get, json
- Language: JavaScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# get-json-data
Make ajax request to get the json data from browser. Not for nodejs, use [request](https://www.npmjs.com/package/request) module instead.## usage
can not be more simpler:include ```index.js``` in your html.
```javascript
getJSONData(url,callback);
//callback function
fucntion callback(err, data) {
if (err) {
console.log('request failed');
return;
}
// do something with data
}
```
### note
This module does not support jsonp. For jsonp request you may use [jsonp](https://www.npmjs.com/package/jsonp) module.
### similar
Here is list of other popular and stable projects
* [superagent](https://github.com/visionmedia/superagent)
* [axios](https://github.com/mzabriskie/axios)
* [qwest](https://github.com/pyrsmk/qwest)
* [A Comparison of JavaScript HTTP Libraries for the Browser](http://www.sitepoint.com/comparison-javascript-http-libraries/)
* [when](https://github.com/cujojs/when)
* [promise](https://github.com/then/promise)
* [async](https://github.com/caolan/async)
* [Loading JSON-formatted data with Ajax and xhr.responseType='json'](https://mathiasbynens.be/notes/xhr-responsetype-json#comments)
* [Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js](http://www.bennadel.com/blog/2327-cross-origin-resource-sharing-cors-ajax-requests-between-jquery-and-node-js.htm)##License
This project is licensed under the terms of the MIT license.