attribute html5 internet-explorer-9 w3c-validation

html5 - attribute - HTML 5 w3c validación



html title attribute (7)

¿Ha intentado no importarle lo que dicen los validadores de HTML sobre su código? Eso suele funcionar para mí.

Validé mi sitio web utilizando validator.w3.org

Se informó el siguiente error:

Line 5, Column 67: Bad value X-UA-Compatible for attribute http-equiv on element meta. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >

Si no incluyo esa etiqueta META, todos los visitantes de IE9 verán mi sitio web en el modo Quirks, y quiero evitarlo.

Cualquier ayuda sería muy apreciada!


El mismo problema aquí, pero mi solución es agregar la siguiente línea a mi archivo .htaccess:

Header set X-UA-Compatible "IE=edge"

Funciona muy bien para mí ...


En su lugar, siempre podría poner la configuración compatible con X-UA en los encabezados HTTP reales. La forma en que lo haga dependerá del servidor web que esté utilizando y del marco del lado del servidor que esté utilizando.


La solución es muy simple y el tema puede incluir este sencillo en las plantillas de características, simplemente abra / templates / YOUR TEMPLATE / warp / systems / themes / head.php

desde

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

a

<!--[if IE]> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <![endif]-->


Para las personas que usan PHP, la forma de pasar este parámetro a través de la función de encabezado en PHP:

header(''X-UA-Compatible: IE=edge,chrome=1'');

Aquí hay una publicación con código + explicación .


Solo tendrás que aceptar el hecho de que si quieres el soporte de IE, deberás renunciar a la puntuación de validación perfecta.

¡Está bien sin embargo, validity != quality


Para chicos que usan ASP.NET MVC

Una opción es usar el filtro de acción en los controladores / acciones. Esto ralentiza un poco las respuestas del servidor, pero no sé los números exactos. Pero es una forma limpia de hacerlo:

/// /// Represents an attribute that is used to add HTTP Headers to a Controller Action response. /// public class HttpHeaderAttribute : ActionFilterAttribute { /// /// Gets or sets the name of the HTTP Header. /// /// The name. public string Name { get; set; } /// /// Gets or sets the value of the HTTP Header. /// /// The value. public string Value { get; set; } /// /// Initializes a new instance of the class. /// /// The name. /// The value. public HttpHeaderAttribute(string name, string value) { Name = name; Value = value; } public override void OnResultExecuted(ResultExecutedContext filterContext) { if(!filterContext.HttpContext.Response.Headers.AllKeys.Contains(Name, StringComparer.OrdinalIgnoreCase)) filterContext.HttpContext.Response.AppendHeader(Name, Value); base.OnResultExecuted(filterContext); } }

Sin embargo, la manera absolutamente mejor y más limpia para mí es usar web.config . Ponga este código en el elemento <system.webServer> :

<httpProtocol> <customHeaders> <!-- http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ Uncomment to serve cross-domain ajax requests <add name="Access-Control-Allow-Origin" value="*" /> --> <!-- Force the latest IE version, in various cases when it may fall back to IE7 mode github.com/rails/rails/commit/123eb25#commitcomment-118920 Use ChromeFrame if it''s installed for a better experience for the poor IE folk --> <add name="X-UA-Compatible" value="IE=Edge,chrome=1" /> <!-- Allow cookies to be set from iframes (for IE only) If needed, uncomment and specify a path or regex in the Location directive <add name="P3P" value="policyref=&quot;/w3c/p3p.xml&quot;, CP=&quot;IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT&quot;" /> --> <!-- A little extra security (by obscurity) --> <remove name="X-Powered-By" /> </customHeaders> </httpProtocol>

Obviamente esto solo funciona en IIS7 +.

HTH