Home > Web Front-end > JS Tutorial > Invalid method to solve javascript:void(0) under ie6

Invalid method to solve javascript:void(0) under ie6

零下一度
Release: 2017-05-17 16:09:03
Original
2495 people have browsed it

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=&#39;none&#39;; 
 winoperate.style.display=&#39;none&#39;;}
 }
 </javascript>
Copy after login

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>
Copy after login


[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

5.

Summarize the difference between href=javascript:void(0) and href=

#6.

Use javascript:void(0) with caution, why not write it like this good

The 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template