I'm trying to simultaneously have a user click a link and have the link open a page as well as kick off a script on my server. How can I do this?

I'm trying to track whether a certain link is clicked or not. This link takes them to say yahoo.com however I want that same link to kickoff a script as well.

Any ideas? Help?

Here is something I tried. I'm using the import script tag to kick off a script however this doesn't work.


function track()
alert('create track doc');
document.write("<scr" + "ipt language='JavaScript' src="someScriptFile" type='text/javascript'></scr"+"ipt>");
return true;
<a href="<A href="http://www.yahoo.com">http://www.yahoo.com" onClick="track()">test</a>