Implement ajaxSetup for reverse compatibility with $.ajaxSetup
·
112 commits
to master
since this release
Example usage
var ajax = require("can-ajax");
ajax.ajaxSetup({
lang: "de"
});Will set the language to German for each request generated by can-ajax.
The xhrFields option is also now available in calls to ajax.ajaxSetup() and ajax():
ajax({
type: "GET",
url: "https://example.com/api/users",
xhrFields: {
withCredentials: true
}
});Enables CORS for the cross-domain request.