A question about refresh

S

sheldonlg

I have a page that gathers information from a database and shows a
status. Asynchronously, some other process modifies that status at a
shortly later time.

I have placed a button on the page to do a refresh of the page. I use
location.reload() as the onClick method.

Here are the results:
1 - Clicking the button does not show the changed status
2 - Hitting F5 does not show the changed status
3 - Clicking the refresh button on the menu bar does not show the
changed status
4 - Clicking the arrow to the right of the address field DOES show the
changed status.

I would like to know how I need to code my refresh button on the page so
that it shows the changed status like #4 above. Any help will be
appreciated.

(I have looked quite a bit through Google, but haven't found the answer
and changing an ini file is not really an option as this is a
mult-purpose page -- I inherited this rather old code).
 
S

sheldonlg

I have a page that gathers information from a database and shows a
status. Asynchronously, some other process modifies that status at a
shortly later time.

I have placed a button on the page to do a refresh of the page. I use
location.reload() as the onClick method.

Here are the results:
1 - Clicking the button does not show the changed status
2 - Hitting F5 does not show the changed status
3 - Clicking the refresh button on the menu bar does not show the
changed status
4 - Clicking the arrow to the right of the address field DOES show the
changed status.

I would like to know how I need to code my refresh button on the page so
that it shows the changed status like #4 above. Any help will be
appreciated.

(I have looked quite a bit through Google, but haven't found the answer
and changing an ini file is not really an option as this is a
mult-purpose page -- I inherited this rather old code).

....and BTW, if it means anything it is written with php4 code and
register_globals=on. (Can't be changed).
 
T

Thomas 'PointedEars' Lahn

sheldonlg said:
I have a page that gathers information from a database and shows a
status. Asynchronously, some other process modifies that status at a
shortly later time.

I have placed a button on the page to do a refresh of the page. I use
location.reload() as the onClick method.

Here are the results:
1 - Clicking the button does not show the changed status
2 - Hitting F5 does not show the changed status
3 - Clicking the refresh button on the menu bar does not show the
changed status
4 - Clicking the arrow to the right of the address field DOES show the
changed status.

If it were not for 2, 3, and 4, window.location.replace(document.URL, true)¹
would have sufficed. However, because of those, you need to apply
I would like to know how I need to code my refresh button on the page so
that it shows the changed status like #4 above. Any help will be
appreciated.

This problem cannot be solved with client-side scripting alone.


PointedEars
___________
¹ Always use qualified references: window.location, window.open(…),
window.alert(…), etc.
 
S

sheldonlg

It would better be changed soon, before it is too late.

Not my call! Besides, this is an INTRAnet application, so all users are
known. There is no way they are going to revamp everything in this
massive application. It still uses the feature that there are variables
that are the same name as the fields automatically without using gets or
posts.
 
J

Jeff North

| On 5/13/2011 3:08 PM, sheldonlg wrote:
| > I have a page that gathers information from a database and shows a
| > status. Asynchronously, some other process modifies that status at a
| > shortly later time.
| >
| > I have placed a button on the page to do a refresh of the page. I use
| > location.reload() as the onClick method.
| >
| > Here are the results:
| > 1 - Clicking the button does not show the changed status
| > 2 - Hitting F5 does not show the changed status
| > 3 - Clicking the refresh button on the menu bar does not show the
| > changed status
| > 4 - Clicking the arrow to the right of the address field DOES show the
| > changed status.
| >
| > I would like to know how I need to code my refresh button on the page so
| > that it shows the changed status like #4 above. Any help will be
| > appreciated.
| >
| > (I have looked quite a bit through Google, but haven't found the answer
| > and changing an ini file is not really an option as this is a
| > mult-purpose page -- I inherited this rather old code).
| >
|
| ...and BTW, if it means anything it is written with php4 code and
| register_globals=on. (Can't be changed).

So are you capturing the returned response from the ajax call?
Are you 100% sure that the information is being written to the
database?
 
T

Thomas 'PointedEars' Lahn

sheldonlg said:
Not my call!

What kind of developer are you anyway? No, don't answer.
Besides, this is an INTRAnet application,
Irrelevant.

so all users are known.

All users are … listen to yourself!
There is no way they are going to revamp everything in this
massive application.

Then they deserve what they will get.
It still uses the feature that there are variables that are the same name
as the fields automatically without using gets or posts.

foreach(array('x', 'y', 'z') as $var)
{
$$var = $_REQUEST[$var];
}

does the same without compromising all security, preferably in local context
(you might want to exclude $_COOKIE, though).


F'up2 comp.lang.php

PointedEars
 
L

Luuk

I have a page that gathers information from a database and shows a
status. Asynchronously, some other process modifies that status at a
shortly later time.

I have placed a button on the page to do a refresh of the page. I use
location.reload() as the onClick method.

Here are the results:
1 - Clicking the button does not show the changed status
2 - Hitting F5 does not show the changed status
3 - Clicking the refresh button on the menu bar does not show the
changed status
4 - Clicking the arrow to the right of the address field DOES show the
changed status.

I would like to know how I need to code my refresh button on the page so
that it shows the changed status like #4 above. Any help will be
appreciated.

(I have looked quite a bit through Google, but haven't found the answer
and changing an ini file is not really an option as this is a
mult-purpose page -- I inherited this rather old code).

It looks like your browser is caching results, something like this:
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
(from: http://php.net/manual/en/function.header.php) might work. Your
browser should stop caching the results.
 
L

Luuk

It looks like your browser is caching results, something like this:
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
(from: http://php.net/manual/en/function.header.php) might work. Your
browser should stop caching the results.

oops, someone forwarded this thread to comp.lang.php and i replied to
that.....

but my answer has nothng to do with Javascript.... ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top