Solved

history.back gives error

Posted on 2004-03-24
5
496 Views
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..
0
Comment
Question by:DGDGDG
  • 2
5 Comments
 
LVL 51

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>

0
 

Author Comment

by:DGDGDG
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....
0
 
LVL 51

Accepted Solution

by:
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>
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After uninstalling Opera browser (for example ver. 10.63), your attempts to open a web page by clicking on a URL link may fail with an error message.  The error is "This operation has been canceled due to restrictions in effect on this computer. Ple…
Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
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…
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 site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

856 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