On Aug 18, 9:12 pm, Ahrjay <[EMAIL PROTECTED]> wrote:
> Just do a test with something you know 1.x doesn't support in
> javascript like
> if(document.ontouchstart)
> {
> 2.x stuff here
>
> } else {
> 1.x stuff here
> }
Hey, I think it's time to move into the new millenium! :-)
<URL: http://www.jibbering.com/faq/faq_notes/not_browser_detect.html >
If the OP's intention is just to collect stats, then the UA string is
as good as any place to start, though it is unreliable and the server
is the best tool, not client-side script. If the intention is to
assume certain features for scripting based on detecting the OS or
browser version, that is not a good strategy (see link above).
Test for the features you want before using them, there are many
existing implementations of this strategy that work very well and
remove reliance on browser sniffing. The benefit is that you don't
have to update your code every time a new browser or version is
released as was the case back in the 90's when there was code like:
var ie = !!document.all;
var dom = !!document.getElementById;
if (ie) {
...
} else if (dom) {
...
}
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---