Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Refresh Page After Back Button Hit

Recommended Posts

Hi. I have a page that is dynamically build through DOM manipulation. So, when I browse outside the page, and then click back, those dynamically created DOM objects are gone. Since I am also using JSP / Servlet technology, I can rebuild this page easily, which I have done. Here is my dilemma. If the user leaves the dynamic page, then clicks back on their browser, I need the page they are going back to to refresh. I can't figure out how to do this. I've tried using the META tag, but it won't do it. Help would be appreciated. Thanks.

Share this post


Link to post
Share on other sites

uhm.. you cant do that, i think.Becouse it wont be the same on every web browser. Try to view that page in IE then try in Opera... then try all of browsers :DDo you see that Opera uses page from cashe memory... im not some exprert but this may help you, or not :D

Share this post


Link to post
Share on other sites

You can do this with meta tags. It won't actually refresh on every visit, but it will tell the clients computer not to store information about the page and instead completely re-download it on each view. You can use the following meta tags (don't know how many are necessary, but it wouldn't hurt to use all of them):

<meta http-equiv="cache-control" content="no-cache"> <!-- tells browser not to cache --><meta http-equiv="expires" content="0"> <!-- says that the cache expires 'now' --><meta http-equiv="pragma" content="no-cache"> <!-- says not to use cached stuff, if there is any -->

Share this post


Link to post
Share on other sites

Someone new, responding with same problem as SqlByte. I tried this solution and it didn't work. Just letting you know. Using Mozilla Firefox. I used all 3 lines. I tried another meta tag, with <meta http-equiv="refresh" content="2"> which does work, but after the initial refresh, I don't want the page to reload each and every time thereafter (always shows it's loading, something people round here would get real antsy about).

Share this post


Link to post
Share on other sites

Can anyone help me, prevent blank screens between page switches

Refresh Page After Back Button Hit

 

Hi I am trying to optimise my site. The situation is this. When a link is clicked and the new page is loaded, my site is intermediate blank.

 

Is there a way where the screen is not blank for a few seconds while the new page load?

 

Fyi. I am running: wamp and drupalcms the pages are in php.

Thanks for the help,

 

 

 

-question by Joel

Share this post


Link to post
Share on other sites

I think work on cache and meta tag will not help much, if you want to reload previous page when back is clicked.I tried many things. Every browser has it own objects so it is difficult to implement. One little and less effective solution is that you keep one button on your page say "Back"<script lang='javascript'> function btnback_click()//go back to previous { window.location.href="previous_page.php"; }</script><body> <input type=button name=btnback id=btnback value=Back onclick='java script:btnback_click()/></body>

Share this post


Link to post
Share on other sites

solution to :Refresh Page After Back Button Hit

Refresh Page After Back Button Hit

 

Inculde the below code in each page of the project...

 

<input type="hidden" id="refreshed" value="no">

 

Though this is not the real solution butone of the trick we can do to acheive this

 

-reply by Jugal Kishore Mahendra

Share this post


Link to post
Share on other sites

auto refresh

Refresh Page After Back Button Hit

 

Ei! I have a question how can you automatically make a page refresh itself but just once... I used meta tags but my page kept refreshing itself over and over again can someone please help me

 

-reply by NrOjB

Share this post


Link to post
Share on other sites

Answer to No-Cache problem

Refresh Page After Back Button Hit

 

This is what I do to accomplish the task of disabling the cache..

 

 

 

The head tag at the end of the document is important!

 

 

 

<html>

 

<head>

 

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

 

<META HTTP-EQUIV="Expires" CONTENT="-1">

 

</head>

 

<body>

 

Body stuff

 

</body>

 

<HEAD>

 

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

 

<META HTTP-EQUIV="Expires" CONTENT="-1">

 

</HEAD>

 

</html>

 

 

 

-reply by Brian hall

Share this post


Link to post
Share on other sites
Need to Reload/Refresh page after a Back is done, keeping prev data entered on that pageRefresh Page After Back Button Hit

Trying to add a captcha to a website.  I am using code that I found on line, and it has to work.  When the user enters a code, the htm code calls a php file that checks validity. If invalid, I have a message and sent the user back to the form/htm page and their previously entered data still displays - as well as the old invalid code they entered AND the old displayed captcha image.  At this point, the actual captcha code and the displayed captcha code are out of synch.  Using the related reload link for the captcha image takes care of the problem, as does a refresh - the code and displayed code will match, the users previous data is still available, and the user just has to change the code that was previously entered as the codes have changed.  Failure to refresh/reload the captcha image or the page will create a mismatch again.

 Need to know how to solve this:

1.)  Need to have the page refresh after doing back - this resolves the problem w/o the user having to do anything.  

2.)  Another way to handle this which is even better - How does one go about submitting the users data for check, and having the original forms page display an error message, clear out the user entered invalid code, and refresh the displayed captcha code?   This way, the user is still on the same form page, their data is still present, they get a message indicating that the codes didnt match, and new codes are available for another try...

 Neophyte in the coding, but understand the algorithms/logic and behind it.  Just need to the code, etc.  Currently, I am pulling back a cached form/htm page with data, that apparently kicks off a new code, leaves the users input available (which is good), but the captcha displayed code is not refreshed, and that is the big issue with the current set up.  (clearning out the user entered code too would be nice).

Have tried using what I have found here in the forums, but various caching code doesnt seem to take care of it.  Putting in a refresh/reload into the htm code doesn't get run (in my thoughts), since one is doing a BACK in the browser and so this is cached, and actually doing a redirect to the calling forms/htm page will reset everything the user entered - and everyone knows how much that could be hated.

Thanks!

-question by Allen

Share this post


Link to post
Share on other sites

Add this in your Header part of view page:< script language="JavaScript">< !--Javascript:window.History.Forward(1);//-->< /script>Remove space before tags..Add this inside body tag:

< body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">< body onUnload="OperaReload()">"Remove space before tags..-reply by Arjun Urs

Share this post


Link to post
Share on other sites

You can do this with meta tags. It won't actually refresh on every visit, but it will tell the clients computer not to store information about the page and instead completely re-download it on each view. You can use the following meta tags (don't know how many are necessary, but it wouldn't hurt to use all of them):

<meta http-equiv="cache-control" content="no-cache"> <!-- tells browser not to cache --> <meta http-equiv="expires" content="0"> <!-- says that the cache expires 'now' --> <meta http-equiv="pragma" content="no-cache"> <!-- says not to use cached stuff, if there is any -->
This is okay, not too bad, but it's a fairly dodgy way of doing it, although it works well enough.

 

 

solution to :Refresh Page After Back Button Hit

Refresh Page After Back Button Hit

 

Inculde the below code in each page of the project...

 

<input type="hidden" id="refreshed" value="no">

 

Though this is not the real solution butone of the trick we can do to acheive this

 

-reply by Jugal Kishore Mahendra


O_o This is a decent solution, because it tells the browser that the page hasn't been refreshed, but it doesn't actually fix the problem, because the browser won't refresh.

 

Best you can do is create a javascript to tell the browser to refresh the page AFTER you hit the back button, and I'm sure you can find a script like that on the internet somewhere...if you really can't, then I can probably make one for you...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.