Obtain the current or last accessed URL

Source: Internet
Author: User

Methods In javascript:

 
1. Document. referrer obtains the url2 and document of the previous page. URL: Get the URL of the current page (note: the URL must be capitalized) 3. The history object of JavaScript. The history object is the property of the window object. The history object has no event, but there are four attributes as follows: in the current window, the URL lenght of the currently displayed document indicates the length of the History Table. Next indicates the next URL in the History Table. Previous indicates the previous URL in the History Table. Description: IE does not support the current of the history object, the next and previous attributes of the history object have three methods: Back (), forward (), and go (). These methods can call the documents contained in the History Table. The back () method is used to load the previous page in the history table. It is equivalent to the back button forward () method in the browser to load the last page in the history table. It is equivalent to the forward button Go () in the browser () method to enter a specific document in the history table. You can take integer or string parameters. Go (n) WHEN n> 0, load the N document of the forward number in the History Table; when n = 0, import the current document; when n <0, load the N document of the subsequent number in the History Table go (String) The URL string in the History table contains the most recent document of this substring.

Methods in ASP. NET:

 
Httpcontext. Current. Request. url get current page url page. Request. urlreferrer. tostring () Get previous page url

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.