This article introduces the commonly used page Jump implementation methods, including js php asp.net implementation code. For more information, see.
Let's first introduce the js practices.
The Code is as follows: |
Copy code |
Function toUrl (ul ){ If ("" = ul | null = ul ){ Alert ("thanks for your attention "); } Else {
Window. open (ul); // This is the new window // Window. location. href = ul; // This is directly redirected to the current page } Return; } |
This is implemented by window. open. Click it to bring up a window,
The selection box pops up in javascript to jump to other pages
The Code is as follows: |
Copy code |
<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> |
Will the user be prompted to confirm the exit? If you click yes, it will jump to logout. asp? Act = logout.
Use html refresh to jump
The Code is as follows: |
Copy code |
<? Php $ Url = "http://www.3ppt.com "; If (! Isset ($ url )) { Exit ('no jump address you '); } ?> |
<META HTTP-EQUIV = "REFRESH" CONTENT = "5; URL = '<? Php echo $ url;?> '">
It will jump to http://www.3ppt.com in 5 seconds.
The Code is as follows: |
Copy code |
Php header () to implement <? Php $ Url = "http://www.3ppt.com "; If (isset ($ url )) { Header ("Location: $ url "); } ?> |
When using php headers, note that there must be no output in front of the header. Otherwise, an error occurs (php header () usage ).
Asp.net jump Method
The Code is as follows: |
Copy code |
Response. Redirect ("index. aspx"); this is much easier |