views:

8

answers:

0

For example, what if for reasons of purity code I replace conditional comments with HTTP_USER_AGENT check? Instead of

<!--[if lt IE7]>
<link rel="stylesheet" href="/css/ie6.css" type="text/css" />
<![endif]-->

i write

<!--#if expr='$HTTP_USER_AGENT=/MSIE 6.0/' -->
<link rel="stylesheet" href="/css/ie6.css" type="text/css" />
<!--#endif -->

Is it considered as good practice? Does it have some latent errors?

UPD: Another way to properly use SSI could be ability to put XML prolog at the top of the XHTML document, but prevent IE6 to toggle quirks mode:

<!--#if expr='$HTTP_USER_AGENT!=/MSIE 6.0/' -->
<?xml version="1.0" encoding="UTF-8"?>
<!--#endif -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;

related questions