所以我有这个数组:
[first_name: false, last_name: false, email: false, month: false, day: false, year: false, password: false, password2: false]
现在,如果我这样做console.log(arrayName.length)
,它将返回 0;为什么?我做错了什么?
//LE
我就是这样做的:
var errors = {};
$('.register-front').delegate('button','click',function(){
var $this = $(this).parent().parent().parent();
$this.find('input,select').each(function(){
if(!$(this).val() || ($(this).val() == '-1'))
{
errors[$(this).attr('name')] = false;
}
});
console.log(errors.length);
return false;
});
我做了一些改变,但我仍然不明白......