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.");
}
});
make ajax request post jquery
$.ajax({
method: "POST",
url: "some.php",
data: { name: "John", location: "Boston" }
})
ajax get request parameters
$.ajax({
url: "ajax.aspx?ajaxid=4&UserID=" + UserID + "&EmailAddress=" + encodeURIComponent(EmailAddress),
success: function(response) {
//Do Something
},
error: function(xhr) {
//Do Something to handle error
}
});
how to get the status of other urls in ajax
$('#main-menu a').on('click', function(event) {
event.preventDefault();
$.ajax(this.href, {
success: function(data) {
$('#main').html($(data).find('#main *'));
$('#notification-bar').text('The page has been successfully loaded');
},
error: function() {
$('#notification-bar').text('An error occurred');
}
});
});
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