ajax格式總結

$.post(url, { id:id },
    function(data){
        if(data.status==1){
            msg_url(data.info);
            window.setTimeout("location.reload()",1000);
        }else{
            msg_url(data.info);
        }
    }, "json");
$.ajax({
 type:"post",
 url:"__APP__/Act/change",
 data:"carId="+carId+"&bookCount="+bookCount,
 dataType:"json",
 success:function(re){
  var price = re.price;
  var totalPrice = re.totalPrice;
  $("#totalSpan").html(totalPrice);
  $("#td"+carId).html(price);
 }
});
相關文章
相關標籤/搜索