Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@fdaciuk/ajax
Advanced tools
Ajax module in Vanilla JS
You can use this module with AMD, CommonJS or just like a method of window
object!
You can install via bower:
bower install ajax
Just download dist/ajax.min.js
file, and add dist/ajax.min.js
on your HTML file:
<script src="js/ajax.min.js"></script>
npm i --save @fdaciuk/ajax
define([ 'Ajax' ], function( Ajax ) {
var ajax = new Ajax();
...
});
var Ajax = require( '@fdaciuk/ajax' );
var ajax = new Ajax();
...
window
objectvar ajax = new window.Ajax();
or
var ajax = new Ajax();
Enjoy ;)
get(url)
Get data as a JSON object.
var ajax = new Ajax();
ajax.get( '/api/users' );
post(url, [ data ])
Save a new register.
var ajax = new Ajax();
ajax.post( '/api/users', { data: 'value' });
put(url, [ data ])
Upgrade part of a register.
var ajax = new Ajax();
ajax.put( '/api/users', { slug: 'john' });
delete(url, [ data ])
Delete a register.
var ajax = new Ajax();
ajax.delete( '/api/users', { id: 1 });
done(response, xhrObject)
Promise that returns if the request was successful.
var ajax = new Ajax();
ajax.get( '/api/users' ).done(function( response, xhr ) {
// Do something
});
error(response, xhrObject)
Promise that returns if the request has an error.
var ajax = new Ajax();
ajax.post( '/api/users', { slug: 'john' }).error(function( response, xhr ) {
// Do something
});
always(response, xhrObject)
That promise always returns, independent if the status is
done
orerror
.
var ajax = new Ajax();
ajax.post( '/api/users', { slug: 'john' }).always(function( response, xhr ) {
// Do something
});
Check CONTRIBUTING.md
https://github.com/reportz/ajax
MIT © Fernando Daciuk
FAQs
Ajax module in Vanilla JS
The npm package @fdaciuk/ajax receives a total of 33 weekly downloads. As such, @fdaciuk/ajax popularity was classified as not popular.
We found that @fdaciuk/ajax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.