Incluir archivo si solo es IE6

Iniciado por Zeroql, 10 Septiembre 2011, 16:57 PM

0 Miembros y 1 Visitante están viendo este tema.

Zeroql

Buenas
bueno tengo este incoveniente,
tengo una web que no me navega bien en IE6 y para no tener que rediseñarla para este navegador, he creado un archivo aparte con el siguiente codigo

Código (html4strict) [Seleccionar]

<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 78px; position: relative;'>
    <div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'>
    <a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'>
        <img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Cierra este aviso'/></a>
    </div>
    <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
      <div style='width: 75px; float: left;'><img src='images/ie6/warning.jpg' alt='¡Aviso!'/></div>
      <div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
        <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>Usted est&aacute; usando un navegador obsoleto.</div>
        <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>Para navegar mejor por este sitio, por favor, actualice su navegador.</div>
      </div>
      <div style='width: 75px; float: left;'><a href='http://www.mozilla-europe.org/es/firefox/' target='_blank'>
      <img src='images/ie6/firefox.gif' style='border: none;' alt='Descargar Firefox'/></a>
      </div>
      <div style='width: 75px; float: left;'>
      <a href='http://www.microsoft.com/downloads/details.aspx?FamilyID=341c2ad5-8c3d-4347-8c03-08cdecd8852b&DisplayLang=es' target='_blank'>
        <img src='images/ie6/ie.gif' style='border: none;' alt='Descargar la ultima version de Internet Explorer'/></a>
      </div>
      <div style='width: 73px; float: left;'><a href='http://www.apple.com/es/safari/download/' target='_blank'>
      <img src='images/ie6/safari.gif' alt='Descargar Safari' style='border: none;'/></a>
      </div>
      <div style='float: left;'><a href='http://www.google.com/chrome?hl=es' target='_blank'>
      <img src='images/ie6/chrome.gif' alt='Descargar  Google Chrome' style='border: none;'/></a>
      </div>
    </div>
</div>


y que en lap pagina web que navege y detecte que es IE6 incluirla

la incluia con iframe pero veo que cuando se cierra la ventana queda el marco
uso este codigo para detectar el IE
Código (html4strict) [Seleccionar]

<!--[if lt IE 7]>><iframe src='ie6alert.html'/></iframe><![endif]-->


alguien conoce de otro metodo para incluir archivos cunado se trata de ie6??

DE ANTE MANO MUCHAS GRACIAS.
Dime y lo olvido, enseñame y lo recuerdo, involucrame y lo aprendo.
/.-ZEROQL.-\   -----  #937675#


madpitbull_99

<!--[if lt IE 7]>><iframe src='ie6alert.html'/></iframe><![endif]-->

Esa también se suele utilizar mucho, pero cambia IE7 por IE6.

Te recomiendo este artículo si quieres hacerlo mediante javascript o ASP: Detecting Internet Explorer More Effectively o este otro: About Conditional Comments.


A eso también se le llama "compilación condicional": Conditional Compilation of JScript/ javascript in IE.


<!--[if IE 6]>
Será interpretado sólo por IE6
<![endif]-->

<![if !IE 6]>
No será interpretado por IE6
<![endif]>


También puedes usar JQuery:

Código (javascript) [Seleccionar]
if($.browser.msie && $.browser.version=="6.0") alert("Estas usando IE6");

En PHP tienes muchas formas de hacerlo, desde expresiones regulares hasta funciones de manejo de cadenas, con regex se haría así:

Código (php) [Seleccionar]
if (preg_match('/\bmsie 6/i', $ua) && !preg_match('/\bopera/i', $ua))
  echo "Estas usando IE6";




«Si quieres la paz prepárate para la guerra» Flavius Vegetius


[Taller]Instalación/Configuración y Teoría de Servicios en Red

Zeroql

madpitbull_99 muchas gracias he optado por la de php, aunque jquery me llama mucho la atencion, me gusta mas anivel servidor. gracias!!!
Dime y lo olvido, enseñame y lo recuerdo, involucrame y lo aprendo.
/.-ZEROQL.-\   -----  #937675#