History.back and displaying information to a page

R

riotctrl

Is there a way to use the history.back to display the actual url of the last
page to the page ?
 
M

Mick White

riotctrl said:
Is there a way to use the history.back to display the actual url of the last
page to the page ?
No, but you can keep track of the url's of the pages that the user has
visited on *your* site. (document.referrer)
Mick
 
R

Randy Webb

Mick said:
No, but you can keep track of the url's of the pages that the user has
visited on *your* site. (document.referrer)

document.referrer will only give you the last page, and it will only
give it to you then if you click a link to get there. Open somepage.html
in your browser, and then open someOtherPage.html from your favorites,
and someOtherPage.html's referrer will be empty. But, click the back
button, or history.go(-1), will take you back to the previous page.

You *might* be able to track all pages on your site with a cookie but I
seriously doubt it (that is, trying to maintain your own history trail).

Let the browser handle it, it has it built in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top