Perhaps something like this? I have not tested it, so it may contain some typo, but the idea is the same ...
<script type="text/javascript">
function mylinkwasclicked(id){
try{
setTimeOut('handlingfunctionname('+id+');',10);
}catch(e){
}
return true;
}
</script>
then your link might look like this:
<a id="linkidentifier" href="somelink.html" onclick="mylinkwasclicked(5)" >click me!</a>
or you can add onclick speaker:
<script type="text/javascript">
var link = document.getElementById('linkidentifier');
link.onclick=function(){mylinkwasclicked(5);};
</script>
Peter source
share