Re: [WSG] Conditional Comments question
Janelle Clemens wrote: I have a question about conditional comments. I have heard so much about them especially in the last discussion about "Set min-width using DOM" but have never used them. We have always used a javascript style sniffer to determine which browser the viewer is using. However when javascript is turned off the site looks pretty nasty. Does conditional comments still work if js is turned off? And is this a better way to go than a javascript style sniffer? What do you do for browsers like mac ie if you don't want it to use the style sheet. With the sniffer I can tell it to use our nostyle.css file. Hi Janelle, Conditional Comments are a feature built into IE Windows (v5.0 and higher). They do not require JavaScript to run. We no longer sniff for browsers. We make sure our pages are going to work in modern browsers and then we correct for IE Windows via CSS delivered through Conditional Comments. We import our style sheets to prevent old browsers from seeing them. The only other browser we sometimes throw a hack in for is IE5 Mac - but very rearely do we need to. Al Sparber - PVII http://www.projectseven.com DW Extensions - Menu Systems - Tutorials - CSS FastPacks - Webdev Newsgroup: news://forums.projectseven.com/pviiwebdev/ CSS Newsgroup: news://forums.projectseven.com/css/ RSS/XML Feeds: http://www.projectseven.com/xml/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] Conditional Comments question
Janelle Clemens wrote: I have a question about conditional comments. I have heard so much about them especially in the last discussion about "Set min-width using DOM" but have never used them. We have always used a javascript style sniffer to determine which browser the viewer is using. However when javascript is turned off the site looks pretty nasty. Does conditional comments still work if js is turned off?And is this a better way to go than a javascript style sniffer? What do you do for browsers like mac ie if you don't want it to use the style sheet. With the sniffer I can tell it to use our nostyle.css file. Until recently, I worked for the NZ Govt. We have rules about displaying macrons in Maori using unicode. We also have rules about sites being usable with JavaScript turned off. Some browser/OS combinations don't do Unicode at all (notably on Mac pre-OSX), so we knew we'd have to detect those exceptions and return them a page without macronised characters. As we couldn't use JavaScript to do the sniffing (plus that would have made all the pages cumbersome), we set the filter (on the www.govt.nz site at least) at the server level using mod_perl on an Apache server and a growing black list as we discovered new browser/OSes that didn't do Unicode . Other sites, running on IIS (ptui) use modified dlls to achieve the same thing (although I think you can now run PERL on IIS (happy to be corrected on that. I can't tell you the technical details as I am not that sort of geek ;-) but Daniel Bar-Even at Signify *is* that sort of geek and has published a page at http://www.signify.co.nz/macronfilter/ about how he did it. Surely, the same sort of server level approach could be used to sniff out the browsers that won't do what you want and serve a different CSS sheet to them? James Ellis made an excellent comment the other day that echoes what I've been telling my business users for years - it won't look the same in different browsers on different platforms, so get over that and concentrate on getting pages that work in all browsers and all platforms to deliver the business need. cheers Mark Harris ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] Conditional Comments question
Janelle Clemens wrote: > I have a question about conditional comments. I have heard so much > about them especially in the last discussion about "Set min-width > using DOM" but have never used them. We have always used a > javascript style sniffer to determine which browser the viewer is > using. However when javascript is turned off the site looks pretty > nasty. Does conditional comments still work if js is turned off? > And is this a better way to go than a javascript style sniffer? > What do you do for browsers like mac ie if you don't want it to use > the style sheet. With the sniffer I can tell it to use our > nostyle.css file. CCs are evil for some and the best thing since sliced bread for others. The good think with JS sniffing is that I believe eveybody agree that it is a bad thing ;) http://www.tjkdesign.com/articles/branching.asp Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
[WSG] Conditional Comments question
I have a question about conditional comments. I have heard so much about them especially in the last discussion about "Set min-width using DOM" but have never used them. We have always used a _javascript_ style sniffer to determine which browser the viewer is using. However when _javascript_ is turned off the site looks pretty nasty. Does conditional comments still work if js is turned off? And is this a better way to go than a _javascript_ style sniffer? What do you do for browsers like mac ie if you don't want it to use the style sheet. With the sniffer I can tell it to use our nostyle.css file. Thanks, Janelle