用的是jquery ajax
success : function(data,textStatus){
var len =data;
alert(typeof(len));-------------------> string
alert(len);---------------------------->ok
if(len=="ok"){
$("#username_msg").html("分类名可以使用");
}else{
$("#username_msg").html("分类名已经存在");
$("#SYS_add").attr("disabled",true);
}
应该在页面提示 分类名可以使用
结果页面却提示 分类名已存在
求指教jQuery Ajax
success : function(data,textStatus){
var len =data;
alert(typeof(len));-------------------> string
alert(len);---------------------------->ok
if(len=="ok"){
$("#username_msg").html("分类名可以使用");
}else{
$("#username_msg").html("分类名已经存在");
$("#SYS_add").attr("disabled",true);
}
应该在页面提示 分类名可以使用
结果页面却提示 分类名已存在
求指教jQuery Ajax
是你少粘贴了呢?还是你就没有写
如果是没有写,八成就是这个问题。
如果你写了,那如果格式没有问题,你就在else里面加个alert
测试下试试