How can I emulate Javascripts History.back() in VBscript

Posted on 2003-03-24
Medium Priority
Last Modified: 2012-05-04
I have an ASP page that is written in vbscript and a bit of Javascript.

I have a section that requires at the end of it to do a history.back()
if I use ASP's response.redirect it causes the page to reload, and I dont want that.

How can I go backwards in vbscript without reloading the page ?
Question by:DCPAus
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8194529
consider i have a.asp and b.asp
i call b.asp from b.asp, and i don't want to go back using history.back();

so in a.asp please do the following

<body onLoad="history.forward(1)">

Accepted Solution

prohacx earned 200 total points
ID: 8194652
Hi there DCPAus!

Of course you can always use some inline Javascript, so instead of using respone.redirect, do something like:

response.write "<html><head></head><body onLoad=""javascript: history.go(-1);"">"
response.write "</body></html>"

That will take you back and if the client doesn't force a reload (which you can set in some browsers), the page will not be reloaded. Also, if you enable caching in ASP, you have less chance of reloading a page.

Happy programming!

LVL 58

Expert Comment

ID: 9313102
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by prohacx

Please leave any comments here within the next seven days.
EE Cleanup Volunteer

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question