您的位置:首页 > 编程语言

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

2017-06-30 10:49 344 查看
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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐