Javascript ajax library with simillar jQuery syntax
npm install @stanimirdim92/ajaxifyThis is a vanilla Javascript AJAX library. The syntax is similar to jQuery.

- JSON
- Document
- Text
- XML
- Blob
- ArrayBuffer
- No JSONP support, sorry. Use CORS!
Available on Bower as stanimirdim92-ajaxify.
```
$ bower install stanimirdim92-ajaxify
Available on NPM as @stanimirdim92/ajaxify.
```
$ npm install @stanimirdim92/ajaxify
ajaxify.ajax({
url: 'test.php',
method: "POST",
data: formData,
dataType: "text",
processData: false,
contentType: false,
headers: {
"my-Awes0mE-H3ad3R": "header4e"
}
}).done(function (response, headers, XHR) {
console.log(response);
console.log(headers);
console.log(XHR);
});
var arr = [10, 20, 30, 'yes', 'no'];
ajaxify.ajax({
url: 'test.php',
method: "POST",
data: arr,
headers: {
"my-Awes0mE-H3ad3R": "header4e"
}
}).done(function (response, headers, XHR) {
console.log(response);
console.log(headers);
console.log(XHR);
});
var t = "yes=thisisatext&no=thisisnotatext";
ajaxify.ajax({
url: 'test.php',
method: "POST",
data: t,
headers: {
"my-Awes0mE-H3ad3R": "header4e"
}
}).done(function (response, headers, XHR) {
console.log(response);
console.log(headers);
console.log(XHR);
});
var obj = {
yes: 'thisIsCamelCase'
};
ajaxify.ajax({
url: 'test.php',
method: "POST",
data: obj,
headers: {
"my-Awes0mE-H3ad3R": "header4e"
}
}).done(function (response, headers, XHR) {
console.log(response);
console.log(headers);
console.log(XHR);
});
####### From PHP file. The script will return plain text, which we parse as XML document
ajaxify.ajax({
url: 'test.php',
method: "GET",
headers: {
"my-Awes0mE-H3ad3R": "header4e"
}
}).done(function (response, headers, XHR) {
console.log(ajaxify.parseXML(response));
console.log(headers);
console.log(XHR);
});
####### Directly from XML file. The script will return an XML object
ajaxify.ajax({
url: 'test.xml',
method: "GET",
headers: {
"my-Awes0mE-H3ad3R": "header4e"
}
}).done(function (response, headers, XHR) {
console.log(response);
console.log(headers);
console.log(XHR);
});
document.querySelector('#imgId').src = blob;
});
document.querySelector('#imgId').src = buffer;
});
TODO:
- File upload
- Progress bar