IE and Conditional Compilation

Conditional Compilation of JScript/ JavaScript in IEIn 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.

Conditional Compilation of JScript/ JavaScript in IE

Essentially, you’re doing a browser sniff without the if-else branching. Other browsers see a comment, IE sees code that it should compile and run. No more document.all tests necessary (or however you’re handling that sort of thing). Really powerful.

technorati tags:, ,

One Response to “IE and Conditional Compilation”
  1. A Modern Fable :: Adam J. McIntyre discusses user experience, web development, web design, CSS, HTML, and JavaScript » Blog Archive » Internet Explorer and Advanced Behaviors Says:

    [...] conditional compilation, how did I not know about this by [...]

I'm Reading…
Search This Site

AddThis Feed Button

Need great hosting?

Categories