[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Sam Sherlock
Often the best solution is to simply avoid troublesome features. I think this article explains the concept well http://www.alistapart.com/articles/testdriven as simple as possible but not simpler 30,000 registered at TNL.net that would be an awful lot to check; which is why checking is the

[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Nick Fitzsimons
2009/9/21 RobG robg...@gmail.com: On Sep 18, 1:32 am, ldexterldesign m...@ldexterldesign.co.uk wrote: A friend of mine just recommend:http://www.quirksmode.org/js/detect.html Don't use it. Don't even consider detecting specific browsers for javascript quirks. For HTML or CSS hacks, go to

[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Mike McNally
Advice to never use browser detection is good advice, but in my experience it's simply impossible to follow. The bad behaviors of old IE browsers - behaviors that are, in effect, bugs, and therefore not features that obey any particular logic - are numerous and pervasive. Facile advice like

[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Mike McNally
Another example, since I've just had to deal with it: try and use fadeIn() and fadeOut() sometime when there's a transparent PNG somewhere in the affected content. There's no fadedPngImagesLookTerrible() predicate I can use. How do I decide what to do? Should I just back off from what I think

[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread RobG
On Sep 22, 1:30 am, Mike McNally emmecin...@gmail.com wrote: Advice to never use browser detection is good advice, but in my experience it's simply impossible to follow. The bad behaviors of old IE browsers - behaviors that are, in effect, bugs, and therefore not features that obey any

[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Mike McNally
PNG graphics with alpha channels are not an exotic luxury. For a broad spectrum of site design approaches - basically anything involving interesting backgrounds or varying page components over which dynamic content may be rendered - not having PNG support means scrapping the design or going to

[jQuery] Re: Browser sniffing - the correct way?

2009-09-20 Thread RobG
On Sep 18, 1:32 am, ldexterldesign m...@ldexterldesign.co.uk wrote: [...] This still leaves the issue of targeting browsers with JS/jQuery. You still seem to be missing the message: trying to compensate for browser quirks by detecting specific browsers is a flawed strategy. Browser detection

[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread ryan.j
comes to supporting CSS correctly. What exactly do you mean by negative vertical span margins? i'd hazard a guess he meant something along the lines of... span { margin: -12px 0 0 0; } On Sep 17, 3:18 pm, Nick Fitzsimons n...@nickfitz.co.uk wrote: 2009/9/17 ldexterldesign

[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread Brett Ritter
On Thu, Sep 17, 2009 at 9:53 AM, ldexterldesign m...@ldexterldesign.co.uk wrote: browser and serve up a load of new CSS. Opera doesn't support negative vertical span margins, so I'm gonna have to reduce the font-size of some text. And there you have a focus: You don't want to detect Opera,

[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread Nick Fitzsimons
2009/9/18 ryan.j ryan.joyce...@googlemail.com: comes to supporting CSS correctly. What exactly do you mean by negative vertical span margins? i'd hazard a guess he meant something along the lines of... span { margin: -12px 0 0 0; } That's what was confusing me. Opera handles negative

[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread ldexterldesign
Yes - you're bang on. Well observed ;] L On Sep 18, 4:47 pm, ryan.j ryan.joyce...@googlemail.com wrote: comes to supporting CSS correctly. What exactly do you mean by negative vertical span margins? i'd hazard a guess he meant something along the lines of... span { margin: -12px 0 0 0;

[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread ldexterldesign
So the question is: how would I detect this? Can this be achieved with jQuery as part of the .support function? (Sorry, the documentation at: http://docs.jquery.com/Utilities/jQuery.support still leaves me what to do with this function, as there are no examples :Z ). Thanks, L On Sep 18, 5:01 

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread ldexterldesign
Is conditional comments in the header my only way out of this? ldexterldesign wrote: Easy guys, I wondered if anyone would be kind enough to point me in the direction of a good browser detection script/plug-in/tool? I've heard/read jQuery.browser isn't the way to go with the latest jQuery

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread Brett Ritter
On Thu, Sep 17, 2009 at 7:02 AM, ldexterldesign m...@ldexterldesign.co.uk wrote: I wondered if anyone would be kind enough to point me in the direction of a good browser detection script/plug-in/tool? I've heard/read jQuery.browser isn't the way to go with the latest jQuery (v.1.3.2).

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread Steven Yang
AFAIK $.broswer is not the way to go in latest jQuery is simply because browser sniffing is not recommended and not the jQuery way of getting things work cross all browsers.and not that because $.browser has problem itself it really depend on why you need to know the different browsers. jQuery

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread ldexterldesign
Thanks for your responses guys. I actually need to detect the Opera browser and serve up a load of new CSS. Opera doesn't support negative vertical span margins, so I'm gonna have to reduce the font-size of some text. I don't know of a 'hack' to target Opera 10, so JS is the only way to go. I

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread ldexterldesign
Cheers Brett. I'll check out your recommendation. L On Sep 17, 12:20 pm, Brett Ritter swift...@swiftone.org wrote: On Thu, Sep 17, 2009 at 7:02 AM, ldexterldesign m...@ldexterldesign.co.uk wrote: I wondered if anyone would be kind enough to point me in the direction of a good browser

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread ldexterldesign
BTW, has anyone got an example of how to use jQuery.support to detect Opera? The doc support on http://docs.jquery.com/Utilities/jQuery.support is awful for this type of thing if it IS possible. Thanks, L On Sep 17, 12:20 pm, Brett Ritter swift...@swiftone.org wrote: On Thu, Sep 17, 2009 at

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread Nick Fitzsimons
2009/9/17 ldexterldesign m...@ldexterldesign.co.uk: Thanks for your responses guys. I actually need to detect the Opera browser and serve up a load of new CSS. Opera doesn't support negative vertical span margins, so I'm gonna have to reduce the font-size of some text. As a general rule,

[jQuery] Re: Browser sniffing - the correct way?

2009-09-17 Thread ldexterldesign
Thanks for prompting me to go back into my CSS and overhaul it. I've solved the issue and now have consistency across all modern browsers (that not including IE7 of course, which I'll see to with conditional comments). Many thanks for your help guys. This still leaves the issue of targeting