+2  A: 

Wrap that block in CDATA tags.

So it looks like like...

<script language="javascript" type="text/javascript">
<![CDATA[
 if ((navigator.userAgent.indexOf("MSIE")) >= "0"){
    document.write("<link rel=\"stylesheet\" href=\"css/common.IE.css\" type=\"text/css\" 
 }
 if ((navigator.userAgent.indexOf("Chrom")) >= "0"){
    document.write("<link rel=\"stylesheet\" href=\"css/common.chrome.css\" type=\"text/css\" />");
 }
]]>
<script>
alex
+2  A: 

break it up in sub-strings so that it does not get detected ..

document.write("<l" + "ink ...

or add comments like this

<script type="text/javascript">
//<!--

if ((navigator.userAgent.indexOf("MSIE")) >= "0"){
    document.write("<link rel=\"stylesheet\" href=\"css/common.IE.css\" type=\"text/css\" 
 }
 if ((navigator.userAgent.indexOf("Chrom")) >= "0"){
    document.write("<link rel=\"stylesheet\" href=\"css/common.chrome.css\" type=\"text/css\" />");
 }


//-->
</script>
Gaby
The first one is kind of a backwards approach for readability when there are modern solutions available. Also, I think CDATA is the best way to wrap it, rather than use the old style JavaScript commented out HTML comments.
alex
+3  A: 

Bad idea. Can you tell us your real issues which are causing you to serve different stylesheets to different browsers?

You should strive to serve all browsers with one stylesheet, and maybe an additional to IE with CondComs ( sounds like condoms ).

meder
Haha, we *do* need protection from IE :P
alex