
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
@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.15/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 });
then(response, xhrObject)
Promise that returns if the request was successful.
var ajax = new Ajax();
ajax.get( '/api/users' ).then(function( response, xhr ) {
// Do something
});
catch(response, xhrObject)
Promise that returns if the request has an error.
var ajax = new Ajax();
ajax.post( '/api/users', { slug: 'john' }).catch(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
});
done(response, xhrObject)
Promise that returns if the request was successful.
done
is deprecated. Use then
instead.
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.
error
is deprecated. Use catch
instead.
var ajax = new Ajax();
ajax.post( '/api/users', { slug: 'john' }).error(function( response, xhr ) {
// Do something
});
Check CONTRIBUTING.md
https://github.com/reportz/ajax
MIT © Fernando Daciuk
FAQs
Ajax module in Vanilla JS
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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.