how to set json type jquery ajax
$.ajax({
type: "POST",
contentType: "application/json",
url: 'http://localhost:16329/Hello',
data: { name: 'norm' },
dataType: "json"
});
how to set json type jquery ajax
$.ajax({
type: "POST",
contentType: "application/json",
url: 'http://localhost:16329/Hello',
data: { name: 'norm' },
dataType: "json"
});
ajax exmaple\
$.ajax({
url:'your url',
type: 'POST', // http method
data: { myData: 'This is my data.' }, // data to submit
success: function (data, status, xhr) { // after success your get data
$('p').append('status: ' + status + ', data: ' + data);
},
error: function (jqXhr, textStatus, errorMessage) { // if any error come then
$('p').append('Error' + errorMessage);
}
});
jquery ajax $.post with data
$.post('http://example.com/form.php', {category:'client', type:'premium'}, function(response){
alert("success");
$("#mypar").html(response.amount);
});
jquery ajax
$.ajax({
url : "file.php",
method : "POST",
data: {
//key : value
action : action ,
key_1 : value_key_1,
key_2 : value_key_2
}
})
.fail(function() { return false; })
// Appel OK
.done(function(data) {
console.log(data);
});
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