jquery ajax 经典实例
$.ajax({ url:"/yjxtj/index.php?m=app&a=purchase", async:true,//同步请求,默认情况下是异步(true) beforeSend:function(){ $(".warning").show(); }, type: 'post', dataType: 'json', data: { uid: uid, packageid: "211005", num: num, totalprice: num*salePrice, }, error:function(request) { alert("Connection error"); }, success:function(data){ var data =eval('('+data+')'); } });