Error: Bad value is X-UA-compatible for the http-equiv attribute on the meta element

This line:

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

causes this error in Firebug:

 Error: Bad value X-UA-Compatible for attribute http-equiv on element meta. 

Why? How can i fix this?

Btw. I am using HTML 5 doctype, for example:

 <!DOCTYPE html> 
+4
source share
3 answers

In Apache, add this to your .htaccess file.

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

Check this article for more error information: http://www.456bereastreet.com/archive/201103/x-ua-compatible_and_html5/

+1
source

You can try to solve this with PHP (source here: http://www.validatethis.co.uk/news/fix-bad-value-x-ua-compatible-once-and-for-all/ ).

 if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) header('X-UA-Compatible: IE=edge,chrome=1'); 

It worked for me!

+1
source

I had the same issue with Firebug. Since IE is the only browser that needs a meta tag, you can wrap the meta tag in an IE conditional block.

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

All Articles