![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
extend-ajax
Advanced tools
npm i extend-ajax --save
send a simple post request
ajax('test/post', 'post').send({
text: 'hello'
}).then(({data})=> {
console.log(data);
})
send a post request and specify global options
var ajax = require('extend-ajax');
ajax.config({
host: 'http://xxx.com/',
convert: (data) => {
return JSON.parse(data);
},
cacheSize: 2
});
ajax('test/post', 'post', {
header: {
'Content-Type': 'json',
'Accept': 'json'
}
}).send().then(({data})=> {
console.log(data);
})
file upload(IE10+)
html:
<input name = "file" type = "file" id = "file">
js:
var ajax = require('extend-ajax');
var files = document.getElementById('file').files;
var fileUpload = ajax('/upload', 'post', {
header: {
'Content-Type': 'formData'
}
}).send({
file: files
}).then(() => {
alert('file is successfully uploaded');
});
jsonp
var JSONP = ajax('/test/jsonp', 'jsonp', {
jsonpParam: 'callback',
jsonpName: 'getDataByJsonp'
});
JSONP.on('success', function (data) {
console.log('get data:' + data + ' with jsonp');
done();
});
JSONP.send();
create one ajax object, but it can't send a request immediately, you need use ajax.send() to send a request.
url <string> a reequest url
method <string> request method。default: 'post'.
options <object>
send the ajax request, if browser support Promise, it will return Promise.If not or jsonp, it will return itself.
abort the ajax request
when browser can't support Promise,ajax.send() will return the ajax object, so you can use ajax.then() to get response.But if type is 'jsonp',ajax.then() will don't work.
add event listener for the ajax object.if async is false, ajax.on() must be called before send,else it will not work.
specify global options, each ajax object will apply the options and own options.
Please use version 1. X and 0. X.
FAQs
an AJAX request library
The npm package extend-ajax receives a total of 0 weekly downloads. As such, extend-ajax popularity was classified as not popular.
We found that extend-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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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.