JavaScript page Jump Methods

Source: Internet
Author: User

First: <script language = "javascript" type = "text/javascript"> window. location. href = "login. jsp? Backurl = "+ window. location. href; </script> type 2: <script language = "javascript"> alert ("return"); window. history. back (-1); </script> 3: <script language = "javascript"> window. navigate ("top. jsp "); </script> Fourth: <script language =" JavaScript "> self.location+'top.htm'; </script> Fifth: <script language = "javascript"> alert ("illegal access! "); Top. location = 'xx. jsp '; </script >==== the selection box in javascript pops up to jump to other pages ===< script language = "javascript"> <! -- Function logout ()... {if (confirm ("are you sure you want to deregister your identity? Yes-Select OK, no-select cancel ")... {window. location. href =" logout. asp? Act = logout "}}--> </script >=== the prompt box in javascript jumps to other pages ===< script language =" javascript "> <! -- Function logout ()... {alert ("are you sure you want to deregister your identity? "); Window. location. href =" logout. asp? Act = logout "} --> </script> window. location =" "; and location. replace (" "); what is the difference? What is the difference between the two websites? For example, can contain parameters, cannot include parameters, and so on. Replace? Or Reload ()? It seems that there is no difference, right? If you have not tried replace (), reload () is to reload this page, and replace () can direct another URL to give you an example: we now have 3 pages (a.html, B .html, c.html). Ignore page. Now, window is used on the B .html page. location. replace ("c.html. location. href ("c.html") into the c.html page. from the user interface, there is no difference, but now the c.html page has a "return" button, using window. location. when href ("c.html" );into the c.html page, When you renew the page, click this "back" button to return to the B .html page, if www.2cto.com and use window. location. replace ("c.html" into the c.html page, the c.html page calls window. history. go (-1); wondow. history. back (); method is not easy to use Will return to a.html. Because window. location. replace ("c.html" contains. Window. location. href ("c.html" example.

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.