关于$.post()没有执行完,就执行后面代码的处理方法

来源:互联网 发布:python list get函数 编辑:程序博客网 时间:2024/06/02 03:40


function checkbuyProduct(pid){

//加上这段代码就可以在当$.post()执行完之后在执行后面的代码

$.ajaxSetup (
   {
    async: false
   }); 

var result = "1";
$.post("product!checkbuyProduct.action?productID="+pid,{},function(data){

if(data == "!ok"){

result = "0";
}

})

alert(result);

return result;
}
阅读全文
1 0
原创粉丝点击