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);}
}
如对本文有疑问, 点击进行留言回复!!
荐 http中status状态为canceled牵扯出的ajax一些问题
网友评论