IE6 javasc#ipt:void (0) Invalid solution

Source: Internet
Author: User
Keywords void (0) Java workaround have any
Tags display help help you internet internet + java javascript jsp

This article is mainly to IE6 under the javasc#ipt:void (0) ineffective solution is introduced, need friends can come to the reference, I hope to help you

IE 6, the link in the JSP 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, under the IE6, will not have any reaction.

The reason is: void (0) is a calculation expression, the result of returning 0 does not have any response to the page;

The OnClick event also triggers the default event for a: void (0)

Solution: Add return false;

<a href= "javascript:void (0);" target= "MainFrame" onclick= "Btnhome_onclick (); return false;" >Home</a>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.