Over a million developers have joined DZone.

Cross Browser Compatibility Tip: Conditional Compile In IE

DZone's Guide to

Cross Browser Compatibility Tip: Conditional Compile In IE

· ·
Free Resource
From: http://www.javascriptkit.com/javatutors/conditionalcompile.shtml
Conditional Compilation of JScript/ JavaScript in IE

In IE, there is a little known feature called conditional compilation. Supported since IE4, this feature starting getting some attention when it began showing up in some Ajax related JavaScripts. An absolute form of object detection, conditional compilation lets you dictate to IE whether to compile certain parts of your JScript or JavaScript code depending on predefined and user defined conditions. Think of it as conditional comments for your script that can also be molded to work gracefully with non IE browsers as well.

Thanks to: http://www.vivabit.com/bollocks/2006/04/06/introducing-dom-builder#c856

#48: Avatar kentaromiura / 19th April '06

You could do like I do here: Crazy corners using IE conditional comment

var cn=�class�;




so you use cn insted of class or classname _; bye

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}