PDA

View Full Version : ondblclick="goNow()" multiple instances



moscarda
02-02-2009, 12:59 AM
I found this neat little script to only goto link on doubleclick:


<script>function goNow() {document.location="http://www.google.com/";}</script>
<a href="#" ondblclick="goNow()">google</a>

but i need to use this several places on the site. how do i do this? i tried using goNow(1), goNow(2), etc, but it didn't work. obviously i'm a javascript beginner, so cut me a little slack. thanks in advance.

Nile
02-02-2009, 01:03 AM
How 'bout this?:


<a href="http://google.com" onclick="return false;" ondblclick="window.location.href=this.href">Google</a>

moscarda
02-02-2009, 01:04 AM
thats perfect, thanks so much

Nile
02-02-2009, 01:04 AM
I'm glad to help you anytime moscarda. Your welcome :).