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
need back button to go back to last page
Old 01-24-2009, 07:30 AM need back button to go back to last page
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
i need to create a button in my cart that will send the visitor back to the page they came from prior to entering the cart.

for instance, someone is on a specific product page and decides to buy something. they click on "add to cart" and it adds it to the cart and takes them to my cart (my cart has to be set up this way, unfortunately). they may then click around in the cart which takes them to other cart pages.

question: if i do a simple javascript that takes them to the current page -1, it may just take them to another page in the cart. i want to take them out of the cart and back to the last product page they visited no matter how many cart pages they have bounced around in.
ericson3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-24-2009, 07:34 AM Re: need back button to go back to last page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
history.go(-1)
__________________
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 01-24-2009, 07:36 AM Re: need back button to go back to last page
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Quote:
Originally Posted by chrishirst View Post
history.go(-1)
Quote:
Originally Posted by ericson3000
i want to take them out of the cart and back to the last product page they visited no matter how many cart pages they have bounced around in.
My, my, Chris... :P

Keep a session variable that updates on each product page and simply link to that variable.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-24-2009, 07:42 AM Re: need back button to go back to last page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's a good point.

moral of the story is: Don't try to answer questions and the phone at the same time.
__________________
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 01-24-2009, 05:49 PM Re: need back button to go back to last page
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
thanks guys, i'll give it a try on monday.
ericson3000 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to need back button to go back to last 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.20800 seconds with 12 queries