1:ajax自已构造一个url,这种方式传参数要用Data,不能用于表单提交。
例:
function fn_check_form(){
if($(\"#Name\").val() == \"\"){
alert(\"人不能为空\");
$(\"#Name\").focus();
return false;
}
}
function showResponse(responseText) {
try{
//alert(responseText);
if(responseText == \'true\'){
alert(\'操作成功!\');
window.location.reload();
}
else if(responseText == \'paramFalse\')
{
alert(\"必填参数不能为空!\")
}
else if(responseText == \'timeError\')
{
alert(\"出发时间不能大于报销时间!\");
}
else{
alert(\'操作失败!\');
// window.location.reload();
}
}catch(e){alert(e.message);}
}
本文地址:https://www.stayed.cn/item/24118
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我