Can history.go also refresh the destination?

I've seen related questions asked a number of times, but I haven't yet seen an answer that does what I need to do.  I display a shopping cart summary block only when the cart contains items.  So when an item is added to the cart, I want to return to the page from where the item was added and show the summary block.  I now use javascript:history.go(-1)(), but you have to hit refresh when you get back to that page.  Can this history call somehow be comibined with location.reload() to cause that history page to refresh itself?  Or is there another solution to this most common of problems?  I'm using ASP if that matters, or if there's a better way to do it.

Thanks!
TexSoftAsked:
Who is Participating?
 
NetGrooveCommented:
Reading my statement in that part does not make any sense :)

Ok, that were two statements:
1.) Use the METAs to make your referring page refresh.
2.) Use referrer address passing to shopping cart page go back to referrer page. Jumping back to referrer page by using its URL is better then calculating history back steps.

Direct jumping to referrer page URL will also refresh your referrer page, even without using the refresh metas.

Does this make sense to you?

0
 
NetGrooveCommented:
Put this metas on your catalog pages:

<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="cache-ontrol" CONTENT="private">
<META HTTP-EQUIV="cache-control" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="0">

And beside the refresh metas is the better way to pass the referrer URL to shoping cart page.
With this URL you can jump back to referrer directly without history steps calculation.

0
 
TexSoftAuthor Commented:
Thanks, NetGroove.  Can you help me understand what you mean when you say " the refresh metas is the better way to pass the referrer URL.  With this URL you can jump back to referrer directly without history steps calculation."?  I'm not sure how these metas affect the url other than not caching the page.

Thanks!

0
 
TexSoftAuthor Commented:
Thanks for the clarification!

One follow-up, if you don't mind.  I guess I'll have to capture the referrer page URL in a session var.  If I use that method, what's your take on using the META's to not cache?  It sounds like I wouldn't need them, and that might save a little bandwidth.

Thanks again for your help -- I really appreciate it.
0
 
NetGrooveCommented:
Thanks for the points.

No, it does save band wide. It increases the traffic.
With caching set to on, that is depending on browser setting defaults, your browser checks the page headers to see whether they were changed since last fetch and they has to fetch the complete page again and use extra band wide.
The upper metas do say: do not make the header check for saving band wide and transfer always the full pages.
With that metas you ensure to have always the pages up to date, but you transfer the pages always and every time.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.