Я использую нативный ajax для решения этой проблемы. Вы можете сделать это с помощью следующих шагов.
ajax = function(options, callback) {
var xhr;
xhr = new XMLHttpRequest();
xhr.open(options.type, options.url, options.async || true);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
return callback(xhr.responseText);
}
};
return xhr.send();
};