$.get ajax jquery code example
Example 1: jquery ajax get
$.ajax({
url: "www.site.com/page",
success: function(data){
$('#data').text(data);
},
error: function(){
alert("There was an error.");
}
});
Example 2: jquery ajax post
$.ajax({
type: "POST",
url: url,
data: data,
success: success,
dataType: dataType
});
Example 3: make ajax request post jquery
$.ajax({
method: "POST",
url: "some.php",
data: { name: "John", location: "Boston" }
})