How to run a handler upon clicking on a hyperlink ?

How to run a handler upon clicking on a hyperlink ?

nemcuonnemcuon Posts: 16Questions: 6Answers: 1

Hi all,

I want to run a piece of javascript when the user clicks on a hyperlink, but I don't know how to do it.

My current (ugly) solution is to click to a cell instead, by using a 'rowCallback'

... 'rowCallback', function rowCallback(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
// Unbind first in order to avoid any duplicate handler (see https://github.com/l-lin/angular-datatables/issues/87)
$('td:eq(4)', nRow).unbind('click');
$('td:eq(4)', nRow).bind('click', function() {
$scope.$apply(function() {
// Call my handlerFunctionUponClick() here
});
});

Any help is welcome.

Answers

This discussion has been closed.