Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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
You can just add the following line to your HTML file:
<script src="https://cdnjs.cloudflare.com/ajax/libs/fdaciuk-ajax/0.0.9/ajax.min.js"></script>
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' );
ajax.get( '/api/users/john' );
post(url, [ data ])
Save a new register or update part of this one.
var ajax = new Ajax();
ajax.post( '/api/users', { slug: 'john' });
put(url, [ data ])
Update an entire register.
var ajax = new Ajax();
ajax.put( '/api/users', { slug: 'john', age: 37 });
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 172 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.