By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,576 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,576 IT Pros & Developers. It's quick & easy.

back() and reload() at the same time?

P: n/a
Hi!

By pressing a button I am directed from one page to another. At the second
page some things displayed on the first page are changed and now I want to
go back to the first page again. The pages are written in php.

If I use javascript:history.back() I get back to the first page but I have
to manually reload it to see the changes I have made.

The solution could be:
echo "<meta http-equiv=\"refresh\"
content=\"0;url=firstpage.php?op=view&id=$id&...&. ..&....\">";
But I have to do a lot of work to get all the options (e.g. op=view&...).

Is there anyway I can use javascript to go back to the first page and force
it to reload, so that I don't have to reload it my self?

Or is there some way I can read out what is in javascript:history.back() so
that I could place it in the above mentioned solution? It doesn't seem to
work if I just do the following:
echo "<meta http-equiv=\"refresh\"
content=\"0;url=javascript:history.back()\">";

Sincerely
Kim Therkelsen, Denmark
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Kim Therkelsen" <kt****@control.auc.dk> schreef in bericht
news:bk**********@sunsite.dk...

By pressing a button I am directed from one page to another. At the second
page some things displayed on the first page are changed and now I want to
go back to the first page again. The pages are written in php.

If I use javascript:history.back() I get back to the first page but I have
to manually reload it to see the changes I have made.
....
Is there anyway I can use javascript to go back to the first page and force it to reload, so that I don't have to reload it my self?


Instead of using JavaScript, you could use a meta cache control header at
the top of firstpage.php.

You could also start firstpage.php with a parameter check, e.g. when the
parameter doesn't exist, throw in a 302 header to append this parameter:

<?
if (!isset($_GET['rnd'])) {
header("Location: {$_SERVER['PHP_SELF']}?rnd=".time());
exit;
}
?>
JW

Jul 20 '05 #2

P: n/a
maybe you could use
"window.navigate(someURL)"
on the second page to navigate "back" to the first page?
"Kim Therkelsen" <kt****@control.auc.dk> wrote in message
news:bk**********@sunsite.dk...
Hi!

By pressing a button I am directed from one page to another. At the second
page some things displayed on the first page are changed and now I want to
go back to the first page again. The pages are written in php.

If I use javascript:history.back() I get back to the first page but I have
to manually reload it to see the changes I have made.

The solution could be:
echo "<meta http-equiv=\"refresh\"
content=\"0;url=firstpage.php?op=view&id=$id&...&. ..&....\">";
But I have to do a lot of work to get all the options (e.g. op=view&...).

Is there anyway I can use javascript to go back to the first page and force it to reload, so that I don't have to reload it my self?

Or is there some way I can read out what is in javascript:history.back() so that I could place it in the above mentioned solution? It doesn't seem to
work if I just do the following:
echo "<meta http-equiv=\"refresh\"
content=\"0;url=javascript:history.back()\">";

Sincerely
Kim Therkelsen, Denmark

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.