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:ie, conditionalcompilation, javascript
October 11th, 2007 at 9:31 am
[...] conditional compilation, how did I not know about this by [...]