Internet explorer 6 under javascript hashipt:void of 0 invalid solution


IE 6, JSP link problem:

< A href = “javascript: void (0);” MainFrame target = "" onClick =” btnHome_onClick () ”>

< Javascript>

The function btnHome_onClick () { Window. The open (com.mcl.com mon. Main. InitHome. “flow”, “the mainFrame”); If (winoperate. Style. The display! {= “none”)   Silde_onClick ();   = ‘none’ sildebar. Style. The display;   = ‘none’ winoperate. Style. The display; } }

< / javascript>

Above code, under IE6, will not have any reaction.

The reason is: void(0) is an expression that returns zero without any response to the page.

After the onClick event, the default event for a is also triggered: void(0)

Solution: return false;