history.back gives error

Posted on 2004-03-24
Medium Priority
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
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
  • 2
LVL 53

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 53

Accepted Solution

Ryan Chong earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses
Course of the Month13 days, 20 hours left to enroll

801 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