https://github.com/codebrahma/jqresource
Restful, Resourceful $AJAX, and knowledgable Javascript.
https://github.com/codebrahma/jqresource
Last synced: 6 months ago
JSON representation
Restful, Resourceful $AJAX, and knowledgable Javascript.
- Host: GitHub
- URL: https://github.com/codebrahma/jqresource
- Owner: Codebrahma
- License: mit
- Created: 2015-01-05T18:39:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-06T18:33:50.000Z (about 11 years ago)
- Last Synced: 2025-07-21T21:13:33.302Z (7 months ago)
- Language: JavaScript
- Homepage: http://codebrahma.com/jqResource
- Size: 824 KB
- Stars: 0
- Watchers: 21
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# jqResource
Restful wrapper around $.ajax which helps you create a data access layer for your javascript applications to encapsulate your domain/business logic and handle sever interactions.
## About
A JavaScript library by Nithin Krishna.
See the [project homepage](http://codebrahma.com/jqResource).
## Installation
Using Bower:
```bash
bower install jq-resource
```
Or grab the [source](https://github.com/codebrahma/jqResource/sc/jqResource.js).
## Usage
Basic usage is as follows:
```javascript
var Question = new $.Resource("/api/test/:test_id/questions/:id",{
id: "id", test_id: "test_id"
});
var Test = new $.Resource("/api/test/:id",{
id: "id"
});
var questions = Question.query();
questions.$state.done(handleSuccess).fatal(handleFailure);
var initialTest = new Test({ code: 25 });
initialTest.show();
initialTest.$state.done(handleSuccess).fatal(handleFailure);
```
## Contributing
We'll check out your contribution if you:
* Provide a comprehensive suite of tests for your fork.
* Have a clear and documented rationale for your changes.
* Package these up in a pull request.
We'll do our best to help you out with any contribution issues you may have.
## License
MIT. See `LICENSE.txt` in this directory.