A nice simple way to handle ajax requests
Code information:
Package information:
Basic usage:
$('a[data-remote]').remote();
Customizing:
$('a[data-remote]').remote({
success: function (response) {
// handle response
this.getTarget().append('<p>Response:</p>').append(response);
}
});
Most options can be passed in the form of an object when instantiating the plugin or in the data-{opition} format:
target
- The place the response should be prepended/appended/placed. SeetargetMethod
targetMethod
- html | prepend | appendtype
- The type of request: IE: 'POST', 'GET'data
- The data to be send in the request
Valid options:
$('a').remote({
data: { foo: 'bar' }
});
$('a').data('foo', 'bar').remote({
data: function () {
var foo = this.$element.data('foo');
return { foo: value };
}
});
@TODO
Here is the issue tracker.
Please refer to the contribuiting guide.