Hi Karl,
On 11/29/06, Karl Guertin <[EMAIL PROTECTED]> wrote:
> > var ua=navigator.userAgent.toLowerCase();
> > if((typeof
> > (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){
> > c.x-=b.offsetLeft;
> > c.y-=b.offsetTop;
> > }
>
> Aside from having no safari version check (and it probably being
> better to check for WebKit rather than Safari), I see no problem with
> that code. It's there specifically to work around problems in
> particular user agents. You have to check user agents to do that. Is
> there something else that you object to?
If you say "Aside from . . ." then it seems that you also think that
this code needs some attention.
Browser sniffing in general is the problem
http://jibbering.com/faq/faq_notes/not_browser_detect.html
navigator.userAgent should be avoided like the plague. The only
exception I've been able to think of is if I want a border to be red
in IE and blue in Safari and I don't really care if it is red or blue
in either browser. That is, I don't care if navigator.userAgent is
lying.
Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---