Je voudrais savoir comment vérifier un tableau qui contient plusieurs variables. Quelque chose comme ça. Je peux expliquer mieux avec le code affiché:comment vérifier un tableau .. dans un tableau? jquery
// Ignore the words in here, they are just there to explan.
var $array = [
alpha = {
name : $('.a'),
date : $('.b'),
street: $('.c')
},
beta = {
name : $('.x'),
date : $('.y'),
street: $('.z')
}
];
/* So now I got this arrays.. withing an array? is that correct?
* or what is this called?
* and now I want to check each object's length, if its 0 -> return false and
* throw out an error, if >= 1 go on and check the next. */
// Check if all needed elements for the toggle to work are existent
$.each($array, function(key, value) {
if (!value.length) {
alert("Could not find "+ '"' + value.selector +'"!')
return false
};
});
// Well obviously this doesnt work..
Merci à l'avance!
vous devriez probablement faire des recherches et de savoir un objet ** ** d'un ** tableau ** – Joseph