history.back gives error

Posted on 2004-03-24
Last Modified: 2006-11-17
I have a page in asp where there is a back button.

<td width="59"><a href="javascript:history.back(-1);"><img src="img/back.gif" width="59" height="25" border="0"&#12288; alt="BACK"></td>

when clicked on back button it is giving error like "for security reasons information posted can not be automatcially displayed. plz click refresh button ". this code works fine on a machine with IE some  machine  but at some other machine, it is giving such error.
Does this occur with some  version of IE? and if so, how to avoid that?
can anyone suggest me a solution?
thanks in advance..
Question by:DGDGDG
  • 2
LVL 49

Expert Comment

by:Ryan Chong
ID: 10666266
>>for security reasons information posted can not be automatcially displayed. plz click refresh button
It's not an error, actually it's the feature of IE browser, as your page before the current page is generating dynamic data and the page itself is not cached. Try post your page before the current page here, and remove any html tag, or server side script that remove page cache.

and always remember to put a "return false" in your link, try:

<td width="59"><a href="back()" onclick="javascript:history.back(-1);return false;"><img src="img/back.gif" width="59" height="25" border="0"&#12288; alt="BACK"></td>


Author Comment

ID: 10666867
thanks for ur help ryancys.
i will try out with this.
but as this msg is beign displayed at some machine and not on the othe, i wud like to know if  thereis  any setting of IE which will disable  the display of such message? any security settings?
thanks in advance....
LVL 49

Accepted Solution

Ryan Chong earned 50 total points
ID: 10698808
do you have a link of that page, or snapshot of that page?

just do a test by replacing the javascript history.back with window.location, see if this problem remain or not, like:

<td width="59"><a href="back()" onclick="javascript:window.location.href='previouspage.asp';return false;"><img src="img/back.gif" width="59" height="25" border="0"&#12288; alt="BACK"></td>

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Chrome - your profile could not be opened correctly 7 111
firefox and saved loggins 5 128
chrome tabs 3 60
Why accessing this airline website ends up with access denied? 19 65
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

930 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now