function testAjax(handleData) {
$.ajax({
url:"getvalue.php",
success:function(data) {
handleData(data);
}
});
}
调用方法
testAjax(function(output){
// here you use the output
alert(output);
});
// Note: the call won't wait for the result,
// so it will continue with the code here while waiting.
转载请注明:谷谷点程序 » jquery ajax function使用方法