Re: [jQuery] jQuery Browser Detection

2007-03-06 Thread Karl Rudd
Ok this is untested but use conditional comments to hide the scripts from IE 5.5 and lower, but shown to IE 6+ and the rest of the browsers you'll need to use this somewhat messy approach. !--[if gte IE 6] ... scripts ... ![endif]-- !--[if !IE]-- ... scripts ... !--![endif]-- You need to include

Re: [jQuery] jQuery Browser Detection

2007-03-06 Thread Aaron Heimlich
On 3/6/07, Oliver Boermans [EMAIL PROTECTED] wrote: Is there a reasonably straight forward method I could employ to lock out IE5 out of jQuery altogether? jQuery(document).ready(function() { if( /MSIE [1-5]/.test(navigator.userAgent ) return; // rest of init code goes here; }); All of

Re: [jQuery] jQuery Browser Detection

2007-03-06 Thread Klaus Hartl
Oliver Boermans schrieb: Clever and almost perfect. IE 6 is rendering -- visibly in the page. Thanks Klaus! On 06/03/07, Klaus Hartl [EMAIL PROTECTED] wrote: Why don't you make it the other way round? !--[if gte IE 6]-- script type=text/javascript src=jquery.js/script !--![endif]--

Re: [jQuery] jQuery Browser Detection

2007-03-06 Thread Oliver Boermans
Thanks Klaus and Aaron, Unfortunately in the site I am working on the JavaScript is broken up into a number of files so I would need to make extensive changes to prevent jQuery being called in IE5.x. Instead I've made changes to ensure there are no problems regardless of whether the scripts work

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Oliver Boermans
IE 5.5 appears to have partial or intermittent support for my jQuery scripts. Although full support would be great - I would prefer IE5.x didn't run my scripts at all than partially. Is there a reasonably straight forward method I could employ to lock out IE5 out of jQuery altogether? On

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Oliver Boermans
Perhaps a little JavaScript inserted with a conditional comment in the head of my document? !--[if lt IE 6] script type=text/javascript //Kill jQuery? ... /script ![endif]-- Thoughts? On 06/03/07, Oliver Boermans [EMAIL PROTECTED] wrote: IE 5.5 appears to have partial or intermittent support

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Klaus Hartl
Oliver Boermans schrieb: Perhaps a little JavaScript inserted with a conditional comment in the head of my document? !--[if lt IE 6] script type=text/javascript //Kill jQuery? ... /script ![endif]-- Thoughts? Why don't you make it the other way round? !--[if gte IE 6]-- script

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Oliver Boermans
As is IE 7. If I remove -- it my JavaScript is also hidden from Firefox and friends :/ On 06/03/07, Oliver Boermans [EMAIL PROTECTED] wrote: IE 6 is rendering -- visibly in the page. ___ jQuery mailing list discuss@jquery.com

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Karl Rudd
You could cheat and put something like this before the main jQuery code. if ( /MSIE [1-5]/.test(navigator.userAgent) ) jQuery = false; This works because the main jQuery code is surrounded with: if(typeof window.jQuery == undefined) { } You would have to make sure the

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Karl Rudd
Try: !--[if gte IE 6] script type=text/javascript src=jquery.js/script ![endif]-- Karl Rudd On 3/6/07, Oliver Boermans [EMAIL PROTECTED] wrote: As is IE 7. If I remove -- it my JavaScript is also hidden from Firefox and friends :/ On 06/03/07, Oliver Boermans [EMAIL PROTECTED] wrote: IE

Re: [jQuery] jQuery Browser Detection

2007-03-05 Thread Karl Rudd
Err scratch that, last reponse of mine. That will hide it from every non-IE browser as well as IE 6. Karl Rudd On 3/6/07, Karl Rudd [EMAIL PROTECTED] wrote: Try: !--[if gte IE 6] script type=text/javascript src=jquery.js/script ![endif]-- Karl Rudd On 3/6/07, Oliver Boermans [EMAIL

Re: [jQuery] jQuery Browser Detection

2006-10-10 Thread Sam Collett
On 09/10/06, Brian Miller [EMAIL PROTECTED] wrote: Sam, if that's a problem with your user base, then there are issues that go beyond the technical. If my users were that hackish and black-hatted, I wouldn't be giving them any front-end code at all if I could avoid it. I mean, if people are

Re: [jQuery] jQuery Browser Detection

2006-10-10 Thread Brian Miller
There's always the Ultimate Browser Sniffer. The most updated version does involve some object detection, but mostly still chops up the user agent string. It also detects the version of JS. http://www.webreference.com/tools/browser/javascript.html View source on the page to see the current

[jQuery] jQuery Browser Detection

2006-10-09 Thread Sam Collett
Currently, jQuery does a browser detect by checking the user agent. However, I think object detection would probably be a better way. This code does that by detecting unique obects on the window object. However, I am not sure what is unique to Safari. // Figure out what browser is being used

Re: [jQuery] jQuery Browser Detection

2006-10-09 Thread Brian Miller
I'm inclined to disagree. I believe that one should use object detection for cases in which they are invoking that object for it's functionality. A prime example is the XHR (although MS may be messing around with that in IE7). But, if one is best served by simply knowing what browser we are

Re: [jQuery] jQuery Browser Detection

2006-10-09 Thread Sam Collett
On 09/10/06, Brian Miller [EMAIL PROTECTED] wrote: I'm inclined to disagree. I believe that one should use object detection for cases in which they are invoking that object for it's functionality. A prime example is the XHR (although MS may be messing around with that in IE7). But, if one

Re: [jQuery] jQuery Browser Detection

2006-10-09 Thread Brandon Aaron
People that know how to change their user agent string will most likely know the possible results of doing so. I don't buy into the notion that we have lots of people changing their user agent string. -- Brandon Aaron On 10/9/06, Sam Collett [EMAIL PROTECTED] wrote: On 09/10/06, Brian Miller

Re: [jQuery] jQuery Browser Detection

2006-10-09 Thread Brian Miller
Sam, if that's a problem with your user base, then there are issues that go beyond the technical. If my users were that hackish and black-hatted, I wouldn't be giving them any front-end code at all if I could avoid it. I mean, if people are technically savvy enough to change their user agent

Re: [jQuery] jQuery Browser Detection

2006-10-09 Thread Andy Matthews
. Subject: Re: [jQuery] jQuery Browser Detection I'm inclined to disagree. I believe that one should use object detection for cases in which they are invoking that object for it's functionality. A prime example is the XHR (although MS may be messing around with that in IE7). But, if one is best

Re: [jQuery] jQuery Browser Detection

2006-10-09 Thread John Resig
Aren't there cases though where the browser tells you the incorrect string? For example, I believe that older versions of IE for Mac said that they were actually a different browser than they really were. The AOL browser also does this same thing I think. Fortunately, neither of those