Tuesday, 20 August 2013

Conditional comments - Include javascript based on IE Version

Conditional comments - Include javascript based on IE Version

I am running a DotNetNuke CMS website built on ASP.NET framework.
I have a few scripts in my page skin that I do not want to run on IE8 and
below. I've been google'ing around, and I've found this IE conditional
statement.
<![if gt IE 8]>
As per http://msdn.microsoft.com/en-us/library/ms537512%28v=vs.85%29.aspx
, this snippit should include the code inbetween for any browser that is
greater than IE8. I attempted to use this conditional statement in the
following manner:
<![if gt IE 8]>
<script type="text/javascript"
src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f21643b21c50811"></script>
<![endif]-->
However, this does not seem to work, and the scripts do not run on any
browser. Is there a better way to accomplish this goal? Is there a syntax
error in my code?
Thanks for your help! Alex

No comments:

Post a Comment