jquery的ajax使用例子

异步的情况:

$.ajax({
         type:'post',
         url:'prepAddDonationReceivingGoods.do',
         data:'method=getSelectInfo&id='+donationPointId+'&submitDate='+submitDate,
         cache:false,
         success:function(result){
                    //alert(result);
                    doSetVal(result);
                 }
      }); 

同步的情况:

$.ajax({
       async: false,
         type:'post',
         url:'addDonationPoint.do',
         data:'method=getIsInCharge&streetId='+streetId,
         cache:false,
         success:function(result){
                    //alert(result);
                    document.getElementById("hasIsInCharge").value=result;
                    //saveForm.hasIsInCharge.value = result;                   
                 }
      }); 

相关推荐