Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/07/2006, 12:57
ratamaster
 
Fecha de Ingreso: octubre-2004
Ubicación: En algún lugar de la República Oriental del Uruguay
Mensajes: 366
Antigüedad: 19 años, 6 meses
Puntos: 0
problema con eval()

Hola
Tengo un problema.
Quiciera cambiar la sentencia eval() por this[], Pero cuando lo hago el código no me varga las variables. Lo siguiente es el código con eval:

Código PHP:
if (success) {
   var 
mytotal=this.total;
   for (
i=0i<=mytotal-1i++) {
      
pic_arr.push(eval("this.foto" add i));                     
      
link_arr.push("noticias/vernoticia.php?notid="+eval("this.id_noticia" add i));
      
noticia_arr.push(eval("this.news" add i));
  }

Este es mi cambio, pero no me funciona:

Código PHP:
if (success) {
   var 
mytotal=this.total;
   for (
i=0i<=mytotal-1i++) {
      
pic_arr.push(this["this.foto" i]);                     
      
link_arr.push("noticias/vernoticia.php?notid="+this["this.id_noticia" +i]);
      
noticia_arr.push(this["this.news" +i]);
  }

gracias
__________________
ratamaster