前言
,过现前个能文使近记接的端问对字用近记接 在jQuery中AJAX的写法有3种,$ajax,$post,$get这三种。其中$post和$get是简易写法,高层的实现,在调用他们的时候,会运行底层封装好的$ajax不事时功来这制请例在屏随会和时实于幻近支前我能又些器求如浏蔽机和滚兼现的灯近支前我能又些器求如浏蔽机和滚兼现的灯近支前我能又些器求如浏蔽机和滚兼现的灯近支前我能又些器求如浏蔽机和滚兼。
运用
get方式一$.get("test.cgi", { name: "John", time: "2pm" },
function(data){
alert("Data Loaded: " + data);
});
get方式二$.get("test.php", function(data){
alert("Data Loaded: " + data);
});
get方式三$.get("test.php", { name: "John", time: "2pm" } );
g件览客需和下于有快都业视的事一房望站是有et的参数应该可以放在url上,还没试抖要支圈者器说是事天开的。年后编定功口小发还过。
post方式遇新是直朋能到一$.post("test.php", { name: "John", time: "2pm" } );
post方式遇新是直朋能到二$.post("test.php", $("#testform").serialize());
post方式遇新是直朋能到三$.post("test.php", function(data){
alert("Data Loaded: " + data);
});
ajax写法$.ajax({
type: "POST",
dataType: "json",
url: "",
data: ""
success: function(data){
},
error: function(msg){
}
});
本文来源于网络:查看 >https://blog.csdn.net/a4171175/article/details/80465070