<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <title id= "Title1" runat= "Server". </title> <script type= "Text/javascript" > function Clickt () { window.location.href= ' pages/client/addclient.jsp '; } </script> <body> <input value= "click" type= "button" onclick= "Clickt ();"/> </body> When I click on the button, I get this result: The page cannot be displayed The page you are are looking for is currently unavailable. The Web site might is experiencing technical difficulties, or you'll need to adjust your settings. Debugging for a long time, do not know what the reason, and then consider the IE6 will be all the labels automatically fill the full address, so write the full path Put function Clickt () { window.location.href= ' www.g.cn '; } Amended to function Clickt () { My project name: CRM11, in this can not add http://, absolute path: As long as the project name/jump page
window.location.href= '/crm11/pages/client/addclient.jsp '; } The problem is resolved, and the final code is as follows: Code
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <title id= "Title1" runat= "Server". </title> <script type= "Text/javascript" > function Clickt () { window.location.href= '/crm11/pages/client/addclient.jsp '; } </script> <body> <input value= "click" type= "button" onclick= "Clickt ();"/> </body> Summary: IE6 under the Window.location.href value must be written on the full address, cannot use relative address. Add a question: IE6 the solution with a label button: 1. The event must return False
<a href= "javascript:void (0);" onclick= "event (); return false;" ></a> 2, the href attribute of a label is set to an anchor point. <a href= "#" onclick= "event ();" ></a>
|