jquery使用小结 备用

*js的方法:给div赋值: document.getElementById("层的id").value=sum;

*jquery给字符串去空格:var pcode = jQuery.trim($("#fittingCode").val());

*jquerypost提交表单

$.ajax({type:"POST", url:"/adult-admin/admin/afterSales/findFittingById.jsp", data:"pcode=" + pcode +"&pcount="+pcount+"&after_sale_order_id="+after_sale_order_id+"&after_sale_cost_id="+after_sale_cost_id , success:function (date) {//根据返回的信息处理  }});

*js解决float计算的问题 将float类型转换为整形来计算

if(11*(amount_pay.value*10)/10 > 11*(real_pay.value*10)/10){
    alert("实付金额要大于等于应付金额!");
    return false;
   }

 

 

 

 

 

你可能感兴趣的:(jquery,jsp,Ajax)