jquery AJAX
作者:互联网
$.ajax({
url: "/greet",
data: {name: 'jenny'},
type: "POST",
dataType: "json",
success: function(data) {
// data = jQuery.parseJSON(data); //dataType指明了返回数据为json类型,故不需要再反序列化
...
}
});
$.post(
"/greet",
{name: 'Brad'},
function(data) {
...
},
"json"
);
$.get(
"/greet",
{name: 'Brad'},
function(data) {
...
},
"json"
);
标签:jquery,function,name,...,json,greet,AJAX,data 来源: https://blog.csdn.net/asd127asd139/article/details/122254158