这是我的JSP代码
<td width="25%" align="left" valign="top" class="mainContainer">
You may start another session by clicking below <a id="loginLink" href="#" onclick="redirectURL()" target="_top"><span>Login</span></a>
</td>
我的JS代码是
function redirectURL(){
window.location.replace(appContext);
};
它在Mozilla中工作正常但在IE中它可以双击。请帮忙。
答案 0 :(得分:0)
锚跳跃是无关的。您可以通过停止锚标记的默认功能来禁用它。
<td width="25%" align="left" valign="top" class="mainContainer">
You may start another session by clicking below <a id="loginLink" href="#" onclick="redirectURL(event)" target="_top"><span>Login</span></a>
</td>
function redirectURL(event)
{
event.preventDefault();
event.stopPropagation();
window.location.replace(appContext);
};