• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Tracking User Navigation

You can use the document object’s referrer property to determine the URL of the page in which the user clicked a link to navigate to the current page. (This property holds a non-empty value only when the user reaches the current page through a link from the previous page.) Here’s an example—when you open Listing 09-05.html, you’ll see a link to the next page, Listing 09-06.html; clicking that link takes you to the next page, where the URL you came from is displayed:

(Listing 09-05.html on the web site)

<HTML> 
    <HEAD> 
        <TITLE>Here's a Web Page</TITLE> 
    </HEAD> 

    <BODY> 
        <H1>Here's a Web Page</H1> 
        <A HREF="09-06.html">Go to the next Web page!</A> 
    </BODY> 
</HTML> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint