jspのレガシープロジェクトに以下のコードがあります。
<tr>
<th colspan="2">Customer</th>
<td colspan="2">
<a href="myAction.do" target="view">CustomerLink</a></td>
</tr>
CustomerLinkをクリックしたときの動作を少し変更したい。アクションを実行する前に、Javascript関数で処理を実行したいだけです。Javascript関数でhrefリンクの動作をシミュレートする方法がわかりませんか?
私が試したこと:-
<tr>
<th colspan="2">Customer</th>
<td colspan="2">
<a href="javascript:customerLinkClicked('myAction.do')" target="view">CustomerLink</a></td>
</tr>
//Javascript関数
function customerLinkClicked(path)
{
// simulate the href link behaviour, not sure how to do this
}