In fact, this problem is closely related to the browser version. As a rookie, I still have not found a perfect solution. No way, because the business must be implemented, so we have to do it in another way:
By redirecting URLs, you can "close" the old window while opening a new window.
Test1.html
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> test1 </TITLE>
<Meta name = "Generator" CONTENT = "EditPlus">
<Meta name = "Author" CONTENT = "">
<Meta name = "Keywords" CONTENT = "">
<Meta name = "Description" CONTENT = "">
</HEAD>
<Script type = "text/javascript">
Function toNewWindow (){
Window. top. location. href = "test2.html ";
}
</Script>
<BODY>
<Input type = "button" value = "open another page test2.html" onclick = "toNewWindow ()">
</BODY>
</HTML>
Test2.html
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> test2.html </TITLE>
<Meta name = "Generator" CONTENT = "EditPlus">
<Meta name = "Author" CONTENT = "">
<Meta name = "Keywords" CONTENT = "">
<Meta name = "Description" CONTENT = "">
</HEAD>
<BODY>
After the URL is rewritten, test2.html
</BODY>
</HTML>
Appendix: page Jump Methods
First:
<Script language = "javascript" type = "text/javascript">
Window. location. href = "/login. jsp? Backurl = "+ window. location. href;
</Script>
Second:
<Script language = "javascript">
Alert ("return ");
Window. history. back (-1 );
</Script>
Third:
<Script language = "javascript">
Window. navigate ("top. jsp ");
</Script>
Fourth:
<Script language = "JavaScript">
Self.location+'top.htm ';
</Script>
Category 5:
<Script language = "javascript">
Alert ("illegal access! ");
Top. location = 'xx. jsp ';
</Script>
===== Jump to other pages through the pop-up selection box in javascript ====
<Script language = "javascript">
<! --
Function logout ()...{
If (confirm ("are you sure you want to log out of your identity? Yes-Select OK, no-select cancel "))...{
Window. location. href = "/logout. asp? Act = logout"
}
}
-->
</Script>
===== Jump to other pages through a prompt box in javascript ====
<Script language = "javascript">
<! --
Function logout ()...{
Alert ("are you sure you want to cancel your identity? ");
Window. location. href = "/logout. asp? Act = logout"
}
-->
</Script>