473,409 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Safari 1.3 bug preventDefault() for click on a link

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('c lick',
function(e){e.preventDefault();}, false);
</script>

Thank you,
Peter

Sep 4 '06 #1
1 1897
VK

pe**********@gmail.com wrote:
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

Sep 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Anderson | last post by:
Sorry if this is a rookie mistake... I've been through all the FAQs and the books I have but I can't see the mistake so I guess it's something simple <g> - I'm an occasional JS user. I've got...
3
by: Marcia Gulesian | last post by:
The following code suppresses the 'enter' key, when run in I.E. 5.5 or later (Windows) but not when run in Safari (Mac) <body onkeypress="javascript:keysuppress(event)" > function...
2
by: Marcia Gulesian | last post by:
The following code suppresses the 'enter' key, when run in I.E. 5.5 or later (Windows) but not when run in Safari (Mac) <body onkeypress="javascript:keysuppress(event)" > function...
3
by: Michael Powe | last post by:
Hello, I am trying to work out the usage of preventDefault() and not having any success. The scenario is that I want to add on onclick handler to a link. When the onclick handler fires, I...
9
by: yb | last post by:
Hi, In Mozilla and IE, setting an event handler for "onmouseover" for a link, (i.e. 'a' element) and return false will prevent the status message from showing the links href value. Safari...
4
by: Doug Lerner | last post by:
In the following script: function txKeyPressHandler(theEvent) { var key = theEvent.which || theEvent.keyCode; switch (key) { case Event.KEY_RETURN: txIMSendMsg(); var userAgent =...
1
by: gubusoft | last post by:
I have a Web page with two frames. The left frame has a DHTML-generated tree of links (to images). The right frame displays the image link you click in the tree of links. It works great on...
2
by: Andrew Poulos | last post by:
Testing locally on an Win XP box with the safari pop up blocker disabled: window.close(); will close the window without warning even though the window was not opened by javascript. win =...
6
by: Andrew Poulos | last post by:
I'm building a app in which opens in a new window without a menu bar or tool bar. I need to warn users (who press the F5 key or Ctrl+R) that refreshing may result in loss of data and to give them...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.