Ajax call new and old
Daisho Komiyama edited this page Apr 15, 2018
·
2 revisions
Konichiwa,
writing ajax call with native JavaScript is a pain. For that reason I tend to use jQuery.
But it seems there was an update using jQuery then
method. The other day it came to my attention.
$.ajax(url, {
dataType: "text",
success: function(contents) {
$modal.html(contents).show();
}
});
$.ajax(url,{ dataType: "text" })
.then(function(contents){
$modal.html(contents).show();
});
By using then
method, ajax call makes more sense to me.