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
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