Ok, I've done some more testing with the simplified script:
<a id="one" href="#one">one</a>
<a id="two" href="#two">two</a>
<script type="text/javascript" charset="utf-8">
$('one').onclick=function(){ return false; };
connect('one', 'onclick', function(e) {
e.stop();
alert('one');
});
connect('two', 'onclick', function(e) {
e.stop();
alert('two');
});
</script>
Basically, rather than adding the onlick attribute in the markup, I
added it in code. And it works properly with Safari 1.3+ and still
works with others. The question now becomes if this is some MochiKit
could/should handle transparently? There's a lot of pre-2.0.4
Safari's out there...
I guess it would be an exception in connect for Safari if the source-
element is an <a> and the event is 'onclick'.
Juergen
On Dec 5, 2006, at 1:40 AM, Beau Hartshorne wrote:
> On 4-Dec-06, at 9:55 PM, Juergen Schreck wrote:
>
>> Found some more info here.
>>
>> http://www.codingforums.com/archive/index.php?t-30983.html
>>
>> Given the date of those posts, and the fact that one of my clients
>> was running 2.0.3 (the latest official version being 2.0.4) it
>> probably was only recently fixed.
>>
>> I don't know if this is some MochiKit can/should work around.
>
> Here's a reduced test you can try:
>
> <a id="one" href="#one" onclick="return false;">one</a>
> <a id="two" href="#two">two</a>
>
> <script type="text/javascript" charset="utf-8">
> connect('one', 'onclick', function(e) {
> e.stop();
> alert('one');
> });
>
> connect('two', 'onclick', function(e) {
> e.stop();
> alert('two');
> });
> </script>
>
> You don't need to return false from the event handlers you call
> with connect, that doesn't do anything. Adding onclick="return
> false;" to the <a> tags shouldn't cause any problems.
>
> Beau
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---