请教以一个jquery问题了,弄不明白为什么,代码如下
php吧
全部回复
仅看楼主
level 7
代码如下:
var error=new Array();
$('input[name="username"]').blur(function(){
var username=$(this).val();
$.get('__URL__/check_register',{'username':username},function(data){
alert(data);//这里确实能哪懂啊data是no,为什么进不来if()里面呢??而是跳到了else了
if(data == 'no'){
error['username']=1;
$('input[name="username"]').after('<span id="umessage" style="color:red">该用户名已经注册</span>');
}else{
alert('1');
error['username']=0;
$('#umessage').remove();
}
});
});
2014年04月07日 06点04分 1
level 7
大神请进,感激
2014年04月07日 06点04分 2
level 7
没人吗
2014年04月07日 07点04分 3
level 7
还没有学到这里 来学习的
2014年04月07日 07点04分 4
level 14
are you 确定?
2014年04月07日 08点04分 5
level 5
空格。。。?
2014年04月07日 08点04分 6
level 7
就是data的值已经传过来是no了,但是if中判断不起作用
2014年04月07日 09点04分 7
level 8
F12查一看返回的数据不就好了?
2014年04月07日 11点04分 8
1