本文共 867 字,大约阅读时间需要 2 分钟。
贴一段代码:
定义:
/** * 封装实体 *carOwnerMobile *carLicenseNo *repairState */function RepairCar(carOwnerMobile,carLicenseNo,repairState){ this.carOwnerMobile=carOwnerMobile; this.carLicenseNo=carLicenseNo; this.repairState=repairState;}
调用:
function doAdd(){ var carOwnerMobile=$('#carOwnerMobile').val(); var carLicenseNo=$('#carLicenseNo').val(); var repairState=$('#repairState').val(); if(validateRegular()){ var repairCar=new RepairCar(carOwnerMobile,carLicenseNo,repairState); //拼凑URL请求地址 var url = "saveRepairCarInfo.msp?repairCar=" + repairCar ; function showMessage(data){ if("N"==data.loginFlag){ alert(data.message); document.location.href="login.html"; return; } alert(data.message); document.location.href="getRepairCarInfoListByPage.msp"; }; ajaxRequestWithObjParam(url,showMessage,repairCar); } }
转载地址:http://onlmd.baihongyu.com/