arrays - jQuery "TypeError: invalid 'in' operand a" -



arrays - jQuery "TypeError: invalid 'in' operand a" -

i have next json array returning ajax call:

{"err":"err_type","fields":["field1","field2"]}

when tryin print out function:

$.each(data.fields, function (i, field) { console.log(field); $.each(field, function (j, f) { $('[name="'+f+'"]').addclass('form_err'); console.log(f); }); });

i this:

data1 typeerror: invalid 'in' operand ...turn function(b){return db(a,b).length>0}}),contains:fb(function(a){return funct...

and can't figure out how utilize array! have idea?

you iterating string, don't need 2 .each() functions

$.each(data.fields, function (i, field) { $('[name="'+field+'"]').addclass('form_err'); console.log(field); });

jquery arrays json each

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -