jquery ajax get
$.ajax({
url: "www.site.com/page",
success: function(data){
$('#data').text(data);
},
error: function(){
alert("There was an error.");
}
});
jquery ajax get
$.ajax({
url: "www.site.com/page",
success: function(data){
$('#data').text(data);
},
error: function(){
alert("There was an error.");
}
});
ajax data post call in javascript
$.ajax({
url: 'ajaxfile.php',
type: 'post',
data: {name:'yogesh',salary: 35000,email: '[email protected]'},
success: function(response){
}
});
ajax get js
let xhr = new XMLHttpRequest();
xhr.open("GET", "une/url");
xhr.responseType = "json";
xhr.send();
xhr.onload = function(){
if (xhr.status != 200){
alert("Erreur " + xhr.status + " : " + xhr.statusText);
}else{
alert(xhr.response.length + " octets téléchargés\n" + JSON.stringify(xhr.response));
}
};
xhr.onerror = function(){
alert("La requête a échoué");
};
xhr.onprogress = function(event){
if (event.lengthComputable){
alert(event.loaded + " octets reçus sur un total de " + event.total);
}
};
javascript ajax get
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
document.getElementById("demo").innerHTML = this.responseText;
}
xhttp.open("GET", URL);
xhttp.send();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us