ajax
module
ajax(settings)
Parameters
- settings
{Object}:Configuration options for the AJAX request. The list of configuration options is the same as for jQuery.ajax.
Returns
{Promise}:
A Promise that resolves to the data. The Promise instance is abortable and exposes an abort method.
Invoking abort on the Promise instance indirectly rejects it.
ajax( settings ) is used to make an asynchronous HTTP (AJAX) request
similar to http://api.jquery.com/jQuery.ajax/jQuery.ajax. The example below
makes use of frag.
ajax({
url: 'http://canjs.com/docs/can.ajax.html',
success: function(document) {
var frag = can.frag(document);
return frag.querySelector(".heading h1").innerText; //-> ajax
}
});