Safari 1.3 bug preventDefault() for click on a link

P

petermichaux

Hi,

The Yahoo! UI event library goes to extremely great lengths to solve
this problem. Their solution is very creative but uses browser
sniffing. In Safari 1.3 (and earlier?) the following example follows
the link when it should not. Does anyone know of any solutions without
browser sniffing?

<p><a id="one" href="http://www.yahoo.com">link cancelled with
e.preventDefault()</a> (isn't cancelled in Safari 1.3, is cancelled in
Safari 2)</p>

<script type="text/javascript" charset="utf-8">
document.getElementById('one').addEventListener('click',
function(e){e.preventDefault();}, false);
</script>

Thank you,
Peter
 
V

VK

Hi,

The Yahoo! UI event library goes to extremely great lengths to solve
this problem. Their solution is very creative but uses browser
sniffing. In Safari 1.3 (and earlier?) the following example follows
the link when it should not. Does anyone know of any solutions without
browser sniffing?

Safari 1.0 - 1.x is in fact the buggy Konqueror's engine badly
transpoded for Mac OS. The reasons and means it was made are still a
big mistery but must be some off-programming issues, most probably some
urgent corporate demand to have an environment equally free from the
Microsoft and Mozilla (=GNU) license obligations.

In any case Safari below 2.0 are not functional in the common sense of
the "satisfactory browsing experience". It does not mean of course that
you cannot cover Safari 1.x versions in your scripts, but it is a task
of the kind of having IE4/NN4 universal script - if you understand what
do I mean. Safari was nearly fully rewritten for v.2.0 and now it is
almost functional (besides being beautiful). I would take this version
as the starting point of the compliance considerations and I would let
the previous versions to die in peace (as it was for NN4, IE5 etc.)

IMHO
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top