Closed Bug 380198 Opened 17 years ago Closed 17 years ago

Implement Conditional Comments similar to IE

Categories

(Firefox :: General, enhancement)

2.0 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 124751

People

(Reporter: blockcipher, Unassigned)

References

()

Details

One of the things that I discovered that makes cross-browser development a bit easier is the conditional comments that IE provides.  The beauty of these is that you don't have to have any weird hacks in your CSS or Javascript.  I was wondering if it would be possible to provide similar functionality in Firefox.

The reason this is coming up is that I have some code that if I do it one way, it works in IE.  If I do it another way, it works in Firefox.  However, I cannot get it to work in both reliably even if I use object detection in Javascript.  I managed to get this to work using IE conditional comments, however the syntax invalidates my HTML as to hide code form IE, it needs to look like this;

<![if !IE]>
blah, blah, blah
<![endif]>

While this does work, there may be times we need to hide FF specific code from other browsers than IE.  By implementing conditional comments in FF, other browsers will treat anything within these blocks as commented out HTML.  One reason to do this would be to hide embedded XUL code from other browsers.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.