Forum Moderators: phranque

Message Too Old, No Replies

Is there a way to auto refresh just once?

         

mmmwowmmm

4:50 pm on Nov 29, 2005 (gmt 0)

10+ Year Member



I have many pages where visitors may leave a comment. After leaving a comment and clicking the "POST COMMENT" button they land on a page with a "CONTINUE" button (which is actually a "back" button) so that they end up at the page they just left a comment on.

But in order to see their comment, they still have to refresh the page. I know the code for an auto refresh:

<META HTTP-EQUIV=Refresh CONTENT="1; (or however many seconds...)

But I don't want the page to refresh more than once. Is there a way to do this?

Or is there a way to code the "CONTINUE" button on the success page so that it goes back AND refreshes? Something like: "onclick=history.go(-1)" but with a refresh tag?

Any advice would be greatly appreciated - thanks

le_gber

1:43 pm on Nov 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi mmmwowmmm,

how about carrying the url of the page they came from in the form / comment they submit.

That whay you jst send them back to the carried forward URL

mmmwowmmm

3:44 pm on Nov 30, 2005 (gmt 0)

10+ Year Member



Well, I created the form in Frontpage, and I've always gotten an error when I tried to make the landing page the same page as the results page. And I don't really know how to handle a form like this from scratch yet.

As for the "refreshing just once" issue, here's the weird thing: when I first created the pages, I used this on the user comments page:

<META HTTP-EQUIV=Refresh CONTENT="10000;

and so whenever you were redirected back to it (from the success) page, it would immediately refresh, and then not refresh again for another 10,000 seconds. It worked fine the first 20 times, and then it suddenly stopped working. I could not figure out why. If I set the time to 600 seconds, it would still refresh after 10 minutes, but it would no longer refresh at the very start, which was what I needed...

What would be perfect is a code that will make the screen refresh once and then stop.

le_gber

12:13 pm on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess using javascript then to refresh the page once if the user is coming from the thankyou-for-posting-page.

mmmwowmmm

2:52 pm on Dec 2, 2005 (gmt 0)

10+ Year Member



That's exactly what I was looking for - the problem is, when the page refreshes, it reactivates the javascript command, so it refreshes again, etc, getting caught in a loop.

What I'm looking for now is a script to put on the thankyou-for-posting page that will redirect the user back to the page that they left the comments on. I know I could specify which url that is in the redirect script, but then I'd have to create a unique "thankyou-for-posting page" for every page that allowed user comments (which is a bunch).

Something like the "onclick=history.go(-1)" command, except it would grab a fresh version of the page (with the comments now on it) from the server and not just pull the old page out of the users cache.