New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(!ie) in conditional comments around html tag #425
Comments
what? |
wondering what purpose the !(IE) serves here: [if (gte IE 9)|!(IE)] also, as documented in the wiki, that first conditional comment contains an extra '<!', apparently because of an issue with dreamweaver and !(ie) conditions in conditional comments. |
I think @dustinhorton don't understand IE conditional comments very well. If this is the case, PPK has a nice post about it. Also you should read Paul Irish's explanation on this topic. I should note that this was linked in the code itself. This is kinda basic stuff. If you google things before posting issues you can save a lot of waiting time for a response. |
i've previously read both posts, and mentioned the second one in my second comment. and i appreciate your concern for my time, but i've googled it and it's nothing critical either way, just something i'm curious about, so i asked. however, neither articles explain the necessity of the !(ie)...ppk's post doesn't even mention that at all. i get the same result, with a few less characters, by just using: [if gte IE 9] |
I remember that it's there for compatibility with Dreamweaver which chokes on IE conditionals. If someone could confirm that... |
@pyrsmk - there is an additional <! in the last conditional comment, apparently needed because dreamweaver has issues with !(IE) in conditionals. according to paul. |
I think you might be able to use this instead of having a
|
yeah that's essentially what i'm suggesting, just different logic. |
thx for bringing it up dustinhorton. the IE conditionals are pretty ugly and from a "i want my markup to feel nice and clean" POV, they really suck. at the same time, they're super useful. as for dreamweaver,i think a small change to my original code (around the that said it's been a long-ass time since i did testing on this so I kinda forget the details. ;) new variations
(via @dustinhorton). AFAICT, we can't do this because it would assume no html tag for non-IE. now technically other browsers would create one but not one with the
(via @necolas) this way you wouldnt need to do an OR to combo
Just a minorly shorter variation. the MSDN page on CCs is pretty weak, so I'm a little unclear what the best way about this is. If someone wants to try a few of these out and report back the findings, i'd be happy to tweak our syntax if we can get away with something smaller / more clear. ♡ |
Just wrote a comment and deleted it on my phone when attempting to edit it...but briefly: I don't believe the html will be ignored. I removed the !(IE), and in all the browsers I tested, the no-js class was still on the tag meaning its not being ignored by non-ie browsers. As I understand ie conditional comments, this makes perfect sense...non-ie browsers don't care about the content within them (either in the condition or the code between the comments). Might not be entirely true. |
OK I've done some quick tests. @paulirish: You cannot use that shorted variation. It failed in IE 8 and @dustinhorton: You're absolutely right about the This is a standard CC, contents inserted only to IE because it is commented out for other browsers.
Adding the extra characters changes the boundaries of the HTML comments for non-IE browsers, while preserving the CC for IE. So the content is seen by all non-IE browsers and any IE browsers that meet the initial condition. This is probably the shortest option for IE9+ and all non-IE browsers.
Although perhaps using |
@dustinhorton != @dustin :) |
On a related point. It seems 'wrong' to use HTML comments outside of the |
Great discussion! @dustinhorton I'm sorry for my initial judgment of your question. It seems I won't have time to test right now, but once you all decide what will be On Fri, Apr 8, 2011 at 6:03 PM, dustin <
|
@necolas great explanation...thank you for doing it much better then i was able to. @irae no sweat. @paulirish i've a few sites in production and haven't seen any issues. will be interested to hear back from others. |
was it determined the <! was still needed after the first conditional even with the !(IE) removed? and if so, is it still just because of dreamweaver? |
@dustinhorton I mentioned in my comment above (but in ref to Paul) that removing the |
ah, yes you did. i thought you were referring to what paul thought i was suggesting (his example of my suggestion is missing a '-->' and '<!--') |
does this serve any purpose? and would removing it allow the removal of those dreamweaver-specific characters in the comment?
The text was updated successfully, but these errors were encountered: