Solved

history.back gives error

Posted on 2004-03-24
5
490 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 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>

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 49

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
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.

744 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

13 Experts available now in Live!

Get 1:1 Help Now