View Single Post
Old 08-20-2008, 01:32 PM   PM User | #10
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
Quote:
Originally Posted by rnd me View Post
try onclick="this.href=location.href; somefunction();return false;"

you could also use onmousedown instead of onclick to cut the click off by about 100ms.

if you are worried about an error in the function, rethread the stack by using settimeout:


onclick="this.href=location.href; setTimeout(somefunction, 35); return false;"
Why in the world are you telling him to set the href of the link to the current page?

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote