
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
jquery-ajax-native
Advanced tools
XHR2 provides a response attribute, that contains a converted response to a native object, depending on the responseType ("arraybuffer", "blob", "document", "json").
See:
https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-response-attribute http://www.html5rocks.com/en/tutorials/file/xhr2/?redirect_from_locale=fr
Using this mechanism provides better performances compared to a javascript way of conversion. For example, converting an ArrayBuffer, leads to a heavy loop (See: http://updates.html5rocks.com/2012/06/How-to-convert-ArrayBuffer-to-and-from-String).
This jQuery Plugin adds XHR2 responseType support, that is currently lacking support in jQuery.ajax and probably remains in the future (See the last comments on this pull request).
Please, take a look at XHR2 current support here for more precision on the support status.
The plugin provides two means to get a native ajax response as follows.
The Plugin provides the native data type for the ajax method that you should use to have a native response. You should also precise the responseType on xhrFields to precise the expected native data type. This usage method allows more customization but it is more verbose.
$.ajax({
dataType: 'native',
url: dataUrl,
xhrFields: {
responseType: 'arraybuffer'
},
success: successCallback
});
The getNative method is a shortened version of the previous method. It allows to specify a success callback only, but returns a promise, and so permets to add the error case.
//With success callback
$.getNative( dataUrl, successCallback );
//Using the returned promise (success and error callbacks respectively)
$.getNative( dataUrl ).then( successCallback, errorCallback );
FAQs
jQuery Plugin that adds XHR2 responseType support
The npm package jquery-ajax-native receives a total of 29 weekly downloads. As such, jquery-ajax-native popularity was classified as not popular.
We found that jquery-ajax-native 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.