Hola, hace un tiempo que tenía ganas de suscribirme aqui. Retomé en estos días el JavaScript, estoy haciendo una serie de utilidades para mi CMS. Una de ellas requiere que encuentre un elemento en un array por una de sus propiedades. Es decir, yo sé que en un array hay un elemento que tiene una propiedad "id" con determinado valor. Hice un script (copiando de otros lados) que pretende hacer eso, pero no parece funcionar. Aquí el código:
Array.prototype.findElementById = function( element_id ) { for( a in this ) { if (this[a].id) { if( this[a].id == element_id ) { return this[a]; } else if( this[a] instanceof Array) { return this[a].findElementById( element_id ); } } } return false; } -- Martin Szyszlican www.ylisto.info ___________________________________________________________ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar _______________________________________________ javaEScript mailing list javaEScript@scriptia.net http://lists.scriptia.net/listinfo.cgi/javaescript-scriptia.net