Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/11/2010, 12:38
Avatar de hey_alan
hey_alan
 
Fecha de Ingreso: diciembre-2006
Ubicación: México
Mensajes: 348
Antigüedad: 17 años, 3 meses
Puntos: 8
Problema con hacks "Coditional Comments" para IE6.

Hola a todos.

Tengo lo siguiente en mi cabecera:

Código HTML:
Ver original
  1. <script type="text/javascript" src="js/jquery.js"></script>
  2. <![if !lt IE 7]><script type="text/javascript" src="js/menu.js"></script><![endif]>
  3. <![if !lt IE 7]><script type="text/javascript" src="js/slideshow.js"></script><![endif]>  
  4. <!--[if lt IE 7]><script type="text/javascript" src="js/pngfix.js"></script><![endif]-->

Lo que quiero es que "menu.js" y "slideshow.js" no sean leídos si el navegador es IE y una versión anterior a la siente.

El código funciona, pero al checarlo en W3C me dice esto:

Cita:

Error Line 12, Column 4: "if" is not a reserved name

<![if !lt IE 7]><script type="text/javascript" src="js/menu.js"></script><![end…


Line 12, Column 7: character data is not allowed here

<![if !lt IE 7]><script type="text/javascript" src="js/menu.js"></script><![end…



You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include:

* putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
* forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
* using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
¿Cuál sería una forma válida?

Gracias.
__________________
Alan Marth Media

Diseño web y Publicidad en Morelia, Michoacán