<a href="<?=$rowz[0]?>" onClick="countLinks('<?=$row[6]?>','<?=$indexl?>')">[Link <?=$j++?>]</a>
The problem is that it doesn’t work with middle button on IE or firefox.
In fact, the countLinks using middle button is called only with chrome.
I think I need a Jquery function like mouseup event, just I don’t know how call that function, which it calls countLinks with those parameters parameters.
Any help?
You’re right. You need a
mousedownormouseupevent to determine which mouse button was actually clicked.But first of all, you need to get rid of that inline-event handler
onclickand follow the shining road of unobtrusive javascript.Thatfor you need to give that anchor a
idorclasstag to identify it (Of course you may also choose to select that anchor with a css selector). Lets assume we have added a class with the name myClazzz 🙂javascript:
The
whichproperty within amousedown/mouseupevent handler will contain a number which indicates which mousebutton was clicked.