Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Javascript get the previous page
Old 07-31-2009, 12:44 PM Javascript get the previous page
Novice Talker

Posts: 12
Name: dorin
Trades: 0
hey

Im looking for a way to get the previous page a visitor came from and store it on a var.
i know there is a way to get the las page with referer, but i want to get the page before the previouse one - history.go(-2)

is there a way to get it under a simple function?

thanks!
__________________
Learn how to
Please login or register to view this content. Registration is FREE
- tonight!
Trace incoming phone calls with
Please login or register to view this content. Registration is FREE
.
dorinn is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-31-2009, 01:10 PM Re: Javascript get the previous page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the history property is an array, so go(-1) is the previous page, go(-2) the one before that etc etc.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-31-2009, 01:27 PM Re: Javascript get the previous page
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
As stated, you can move the page back, but if you're looking to spy on where someone came from, you simply can't. The history object used to have a record of all of the previous pages, but for a decade or so that functionality has been blocked for privacy reasons. The referer is not blocked, but that is an HTTP header and outside the realm of JS.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-31-2009, 01:58 PM Re: Javascript get the previous page
Novice Talker

Posts: 12
Name: dorin
Trades: 0
As i thought...
Thanks anyway
__________________
Learn how to
Please login or register to view this content. Registration is FREE
- tonight!
Trace incoming phone calls with
Please login or register to view this content. Registration is FREE
.
dorinn is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Javascript get the previous page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.64314 seconds with 12 queries