Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #2038 > unrolled thread

A question about refresh

Started bysheldonlg <sheldonlg@thevillages.net>
First post2011-05-13 15:08 -0400
Last post2011-05-14 10:22 +0200
Articles 10 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  A question about refresh sheldonlg <sheldonlg@thevillages.net> - 2011-05-13 15:08 -0400
    Re: A question about refresh sheldonlg <sheldonlg@thevillages.net> - 2011-05-13 15:10 -0400
      Re: A question about refresh Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-13 21:24 +0200
        Re: A question about refresh Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-13 21:28 +0200
        Re: A question about refresh sheldonlg <sheldonlg@thevillages.net> - 2011-05-13 16:28 -0400
          Re: A question about refresh Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-14 09:31 +0200
      Re: A question about refresh Jeff North <jnorthau@yahoo.com.au> - 2011-05-14 10:08 +1000
    Re: A question about refresh Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-13 21:21 +0200
    Re: A question about refresh Luuk <Luuk@invalid.lan> - 2011-05-14 09:50 +0200
      Re: A question about refresh Luuk <Luuk@invalid.lan> - 2011-05-14 10:22 +0200

#2038 — A question about refresh

Fromsheldonlg <sheldonlg@thevillages.net>
Date2011-05-13 15:08 -0400
SubjectA question about refresh
Message-ID<iqjvks$jff$1@dont-email.me>
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).

-- 
Shelly

[toc] | [next] | [standalone]


#2039

Fromsheldonlg <sheldonlg@thevillages.net>
Date2011-05-13 15:10 -0400
Message-ID<iqjvn8$jh0$1@dont-email.me>
In reply to#2038
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).

-- 
Shelly

[toc] | [prev] | [next] | [standalone]


#2042

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-05-13 21:24 +0200
Message-ID<4241969.rdbgypaU67@PointedEars.de>
In reply to#2039
sheldonlg wrote:

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

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

<http://www.php.net/archive/2008.php#id2008-08-07-1>
<http://php.net/manual/en/ini.core.php>


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#2045

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-05-13 21:28 +0200
Message-ID<5331750.9J7NaK4W3v@PointedEars.de>
In reply to#2042
Thomas 'PointedEars' Lahn wrote:

> sheldonlg wrote:
>> ...and BTW, if it means anything it is written with php4 code and
>> register_globals=on.  (Can't be changed).
> 
> It would better be changed soon, before it is too late.
> 
> <http://www.php.net/archive/2008.php#id2008-08-07-1>
> <http://php.net/manual/en/ini.core.php>

and

<http://php.net/manual/en/migration53.deprecated.php>


F'up2 comp.lang.php

PointedEars
-- 
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
 -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)

[toc] | [prev] | [next] | [standalone]


#2054

Fromsheldonlg <sheldonlg@thevillages.net>
Date2011-05-13 16:28 -0400
Message-ID<iqk4ao$58n$1@dont-email.me>
In reply to#2042
On 5/13/2011 3:24 PM, Thomas 'PointedEars' Lahn wrote:
> sheldonlg wrote:
>
>> ...and BTW, if it means anything it is written with php4 code and
>> register_globals=on.  (Can't be changed).
>
> 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.

>
> <http://www.php.net/archive/2008.php#id2008-08-07-1>
> <http://php.net/manual/en/ini.core.php>
>
>
> PointedEars


-- 
Shelly

[toc] | [prev] | [next] | [standalone]


#2077

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-05-14 09:31 +0200
Message-ID<2049253.lGaqSPkdTl@PointedEars.de>
In reply to#2054
sheldonlg wrote:

> Thomas 'PointedEars' Lahn wrote:
>> sheldonlg wrote:
>>> ...and BTW, if it means anything it is written with php4 code and
>>> register_globals=on.  (Can't be changed).
>>
>> It would better be changed soon, before it is too late.
> 
> 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
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

[toc] | [prev] | [next] | [standalone]


#2075

FromJeff North <jnorthau@yahoo.com.au>
Date2011-05-14 10:08 +1000
Message-ID<3uhrs6h0aksf3nm8q14nsp9k9adb93b7ev@4ax.com>
In reply to#2039
On Fri, 13 May 2011 15:10:09 -0400, in comp.lang.javascript sheldonlg
<sheldonlg@thevillages.net>
<iqjvn8$jh0$1@dont-email.me> wrote:

>| 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?

[toc] | [prev] | [next] | [standalone]


#2040

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-05-13 21:21 +0200
Message-ID<2706448.dWV9SEqChM@PointedEars.de>
In reply to#2038
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.

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 
<http://www.mnot.net/cache_docs/>.
 
> 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.
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#2078

FromLuuk <Luuk@invalid.lan>
Date2011-05-14 09:50 +0200
Message-ID<4dce3456$0$32470$e4fe514c@news.xs4all.nl>
In reply to#2038
On 13-05-2011 21:08, 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).
> 

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.




-- 
Luuk

[toc] | [prev] | [next] | [standalone]


#2079

FromLuuk <Luuk@invalid.lan>
Date2011-05-14 10:22 +0200
Message-ID<4dce3bc6$0$81484$e4fe514c@news.xs4all.nl>
In reply to#2078
On 14-05-2011 09:50, Luuk wrote:
> On 13-05-2011 21:08, 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).
>>
> 
> 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.... ;)

-- 
Luuk

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web