Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/07/2009, 14:32
Avatar de kaninox
kaninox
 
Fecha de Ingreso: septiembre-2005
Ubicación: In my House
Mensajes: 3.597
Antigüedad: 18 años, 7 meses
Puntos: 49
Script no me valida en w3c

hola, tengo un rotador de imagenes y me da error cuando la pinto, porque no puedo poner un tag segun la w3c dentro de javascrit alguna sugerencia....

Código javascript:
Ver original
  1. <script language="JavaScript" type="text/javascript">
  2.  
  3. banners= new Array();
  4. banners[0]="img_al/image1.png";
  5. banners[1]="img_al/image2.png";
  6. banners[2]="img_al/image3.png";
  7. banners[3]="img_al/image4.png";
  8. banners[4]="img_al/image5.png";
  9. banners[5]="img_al/image6.png";
  10. banners[6]="img_al/image7.png";
  11. banners[7]="img_al/image8.png";
  12. banners[8]="img_al/image9.png";
  13. banners[9]="img_al/image10.png";
  14. banners[10]="img_al/image11.png";
  15. banners[11]="img_al/image12.png";
  16.  
  17. totalbanners = banners.length;
  18. var ahora = new Date()
  19. var segundos = ahora.getSeconds()
  20. var ad = segundos % totalbanners;
  21. seleccionado=banners[ad];
  22. localizador=seleccionado.lastIndexOf('.');
  23. localizador2=localizador+4
  24. extension=seleccionado.substring(localizador+1,localizador2);
  25. archivo=seleccionado.substring(0,localizador);
  26.  
  27.  
  28. document.write('<img src='+seleccionado+' width="280" height="498" title="mititulo" alt="nodisponible" />');
  29.  
  30. // Fin
  31. // Fin
  32. </script>

me dice :

Código:
…80" height="498" title="mititulo" alt="nodisponible" />');

✉

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
__________________
Gokuh Salvo al mundo. PUNTO!!!!