After spending a few days researching Ajax to use with the Django Python framework, I came across numerous resources on the topic.
1.
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", "ajax_info.txt", true);
xhttp.send();
}
$.ajax({
type: "POST",
url: actionUrl,
....
});
fetch("api/xxx", {
method: "post",
}
.then(...)
Are these three examples essentially the same?