Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/06/2012, 06:01
Chory
 
Fecha de Ingreso: agosto-2005
Mensajes: 18
Antigüedad: 19 años, 1 mes
Puntos: 0
Pregunta javascript y xml

Cita:
Como no encuentro el apartado de XML y los datos los manejo con JS lo posteo aqui, si no es el lugar correcto pido disculpas
Vereis, estoy haciendo un plugin para un CMS, en el cual useo PHP para crear el XML, que despues mediante JS y Ajax, manipulo.
Este plugin es parecido al que usa FB para mostrar las imagenes y permitir comentarios ( esto ultimo me falta por implementarlo )
El problema que me surge es que me tarda muchiiiisimo en obtener los datos de las imagenes, por lo cual decidi anularlo y probar la velocidad de carga, y todo perfecto.

Estoy pensando que por algun motivo, al recibir el XML, JS ya me esta cargando directamente las imagenes en memoria, en lugar de el enlace a las mismas, ¿ es eso posible ?

El XML generado es este
Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <album>
  3. <album_Id>6</album_Id>
  4. <album_Nombre>Concierto de Juan Magan (19/05/2012)</album_Nombre>
  5. <user_ID>1</user_ID>
  6. <album_Des>Fotos obtenidas en el preventivo llevado a cabo durante el concierto de Juan Magan, en el Pabellón Provincial de Deportes</album_Des>
  7. <album_Tags>conciertos fiestas mayo 2012</album_Tags>
  8. <rutafotos>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/</rutafotos>
  9. <fotosHay> </fotosHay>
  10. <autor>Alberto</autor>
  11. <categoria>Fiestas</categoria>
  12. <foto><lafoto>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/WP_000058.jpg</lafoto><foto_Id>35</foto_Id><foto_Des></foto_Des><foto_Ancho>768</foto_Ancho><foto_Alto>1024</foto_Alto></foto>
  13. <foto><lafoto>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/WP_000059.jpg</lafoto><foto_Id>36</foto_Id><foto_Des></foto_Des><foto_Ancho>768</foto_Ancho><foto_Alto>1024</foto_Alto></foto>
  14. <foto><lafoto>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/WP_000065.jpg</lafoto><foto_Id>37</foto_Id><foto_Des></foto_Des><foto_Ancho>1024</foto_Ancho><foto_Alto>768</foto_Alto></foto>
  15. <foto><lafoto>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/WP_000068.jpg</lafoto><foto_Id>38</foto_Id><foto_Des></foto_Des><foto_Ancho>768</foto_Ancho><foto_Alto>1024</foto_Alto></foto>
  16. <foto><lafoto>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/WP_000069.jpg</lafoto><foto_Id>39</foto_Id><foto_Des></foto_Des><foto_Ancho>768</foto_Ancho><foto_Alto>1024</foto_Alto></foto>
  17. <foto><lafoto>http://i1148.photobucket.com/albums/o568/pcvillamuriel/ConciertoJuanMagan/WP_000070.jpg</lafoto><foto_Id>40</foto_Id><foto_Des></foto_Des><foto_Ancho>768</foto_Ancho><foto_Alto>1024</foto_Alto></foto>
  18. <fecha>miercoles, 30-05-2012</fecha>
  19. <hora>08:05:55</hora>
  20. </album>

y el JS, donde cojo la imagen es este
Código Javascript:
Ver original
  1. laFoto=0;
  2.         Fotos=new Array();
  3.         idFoto=new Array();
  4.         anchos=new Array();
  5.         altos=new Array();
  6.         if (a.length>0)
  7.         {
  8.             document.getElementById('album-foto').style.backgroundImage="url("+a[0].getElementsByTagName("lafoto")[0].firstChild.nodeValue+")";
  9.             for(b=0; b<a.length; b++)
  10.             {
  11.                 var c=a[b];
  12.                 d=c.getElementsByTagName("lafoto")[0].firstChild.nodeValue;
  13.                 Fotos.push(d);
  14.                 d=c.getElementsByTagName("foto_Id")[0].firstChild.nodeValue;
  15.                 idFoto.push(d);
  16.                 d=c.getElementsByTagName("foto_Alto")[0].firstChild.nodeValue;
  17.                 altos.push(d);
  18.                 d=c.getElementsByTagName("foto_Ancho")[0].firstChild.nodeValue;
  19.                 anchos.push(d);
  20.             }
  21.         }

se os ocurre cual podria ser el motivo, despues del curre que me ha llevado hacerlo, esto me esta desesperando.
¡¡¡ GRACIAS !!!