Try putting:
Event.stop(event);
Inside _srcListClick.
On 7/16/06, Marco M. Jaeger <mail-yVS5avHIROZWk0Htik3J/w@public.gmane.org>
wrote:>
>
>
>
>
>
>
> Hello,
>
>
>
> Let''s say I have an html markup like this:
>
>
>
> <ul id="srcList">
>
> <li><a href="#url" rel="0|0">link
1</a></li>
>
> <li><a href="url" onclick="javascript:
return false;">link
> 2</a></li>
>
> <li><a href="url" onclick="javascript:
return false;">link
> 3</a></li>
>
> <li><a href="url" onclick="javascript:
return false;">link
> 4</a></li>
>
> </ul>
>
>
>
> The eventObserver is on the UL tag – what is the best way to prevent the
> default execution when a link is clicked;
>
>
>
> Using #url as the href works as does this: onclick="javascript: return
> false;"
>
>
>
> I was just wondering what the best practice would be.
>
>
>
> The event observer looks like this:
>
>
>
> this.eventSrcListClick >
this._srcListClick.bindAsEventListener(this);
>
>
Event.observe(''srcList'', ''click'',
> this.eventSrcListClick);
>
>
>
> And the function looks like this:
>
>
>
> _srcListClick: function(event)
> {
>
> var element = Event.findElement(event,
> ''A'');
>
>
>
> },
>
>
>
> Thank you in advance for your input
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs