R
RobG
On Aug 26, 11:10 am, "Richard Cornford" <Rich...@litotes.demon.co.uk>
wrote: [...]| --jquery-1.1.4.js:1604---------------------------------------------
| // check if target is a textnode (safari)
| if (jQuery.browser.safari && event.target.nodeType == 3)
| event.target = originalEvent.target.parentNode;
But why only when the browser
is safari? If event.target's being a text node is a problem on safari
shouldn't it also be a problem on any browser where it is a text node?
Good question. I will raise some of these questions to the developers,
because I am curious to know the reasoning as well. Surely they are
not perfect and would be open to code improvements.
Early versions of Safari returned a text node if that was the node
that started the event, other browsers don't.
[...]
No - if a user configures their browser to lie about what it is, then
they should expect unpredictable results. In the absence of users
trying to purposely confuse the code, I've been extremely happy with
the cross-browser capabilities of jQuery and I've yet to come across a
real-world situation where it failed to work as expected.
I find programmers who can't keep their browser sniffing up-to-date to
be a much bigger problem. eBay keeps telling me to update my browser
when I visit using Safari 3 (but not with version 2). I've repeatedly
asked them to what verison, they don't respond.
The use of browser sniffing is becoming more prevelent, its inclusion
in popular libraries only encourages bad programming.
My ISP uses browser sniffing to deliver totally different pages to
different browsers, significant portions of the site are degraded if
you use a browser they've decided not to support. Banks are starting
to do the same again too after many years of reducing its incidence,
I've even seen sites attempting to detect "mobile Safari", and
detection scripts up to 500 lines (there are probably much longer
ones) that fail to recognise many reasonably popular browsers.
It is a return to the bad old days, we really shouldn't need to go
back there.