link_to ...onclick + ondoubleclick

I wrote a test link :

<%= link_to("test dbl click", root_url, :ondblclick => "alert('Double Clicked');") %>

the double click event is captured (alert displayed) but at the same time the home page is also displayed , is there a way to wait for the ok on the panel before executing the link?

<%= link_to("test dbl click", root_url, :ondblclick => "alert('Double Clicked');") %>

the double click event is captured (alert displayed) but at the same time the home page is also displayed , is there a way to wait for the ok on the panel before executing the link?

<%= link_to("test dbl click", root_url, :ondblclick => "return confirm('Double Clicked');") %>

Why the double click? If you don't need that you can get away with:

<%= link_to("test confirmed click", root_url, :confirm => "Press OK to go to root url") %>

-philip