This article mainly introduces the solution to the invalid problem of javascript:void(0) under IE6. Friends who need it can come and refer to it. I hope it will be helpful to everyone
IE 6, JSP link problem:
<a href="javascript:void(0);" target="mainFrame" onClick="btnHome_onClick()"> <javascript> function btnHome_onClick(){window.open("com.mcl.common.main.InitHome.flow","mainFrame"); if(winoperate.style.display != "none") { silde_onClick(); sildebar.style.display='none'; winoperate.style.display='none';} } </javascript>
The above code will not have any response under IE6.
The reason is: void(0) is a calculation expression, and the result of returning 0 will not have any response to the page;
After the onClick event, the default event of a will also be triggered: void (0)
Solution: add return false;
<a href="javascript:void(0);" target="mainFrame" onClick="btnHome_onClick();return false;">Home</a>
[Related recommendations]
1. Special recommendation: "php Programmer Toolbox" V0.1 version download
2. Free js online video tutorial
##3.php.cn Dugu Jiujian (3) - JavaScript video tutorial##4.
Definition and detailed explanation of operator void(0) in Javascript Summarize the difference between href=javascript:void(0) and href=Use javascript:void(0) with caution, why not write it like this goodThe above is the detailed content of Invalid method to solve javascript:void(0) under ie6. For more information, please follow other related articles on the PHP Chinese website!