Convert Javascript XMLHttpRequest to jQuery

Can this code be converted to jQuery code? For example, using: jQuery.get(). Although I do not think so responsetype arraybuffer.

var request = new XMLHttpRequest();
request.open("GET", url, true);
request.responseType = "arraybuffer";
request.onload = function() {
  // do stuff
}

request.send();

EDIT

I am trying to create a Chrome HTML5 Web Audio plugin for jQuery. So I try jQuerify, where possible. Check what I'm trying to convert @ http://pieterhordijk.com/sandbox/html5-audio-api/webkit-audiocontext-interface/adding-a-basic-control

Caution, do not press the play button with the volume, since you can only stop it with a page refresh :)

+3
source share
1 answer
$.get(url, function (data) {
    // do useful things with data
});

Adjust the parameters as you wish, see jQuery.get().

+1
source

All Articles