FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Is there a way to distinguish an auto-refresh from a manual page load?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Is there a way to distinguish an auto-refresh from a manual page load? [message #177206 is a reply to message #177203] Mon, 27 February 2012 12:00 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
Álvaro G. Vicario wrote:
> El 24/02/2012 14:26, The Natural Philosopher escribió/wrote:
>> Álvaro G. Vicario wrote:
>>> El 22/02/2012 23:26, The Natural Philosopher escribió/wrote:
>>>> Cos I want to make a page slightly different depending...
>>>> ..I cant think of any parameter I might pass that would be affected by
>>>> autorefersh or not tho.
>>>>
>>>> Maybe javsacript and a timer would enable one?
>>>
>>> The "auto-refresh" concept implies some previous work on your side.
>>> It'd help a lot to know what's the code you wrote to accomplish it
>>> (JavaScript, <meta> tag or whatever). Whatever, I have the impression
>>> that it'd help even more to know the problem you want to fix rather
>>> than just the solution you figured out.
>>>
>>>
>> Well I used a meta tag so that the client refreshes in case new info has
>> come in.
>>
>> However in this case the client can also POST new information, and I
>> don't want it POSTING the same information every 5 minutes or whatever.
>
> Then, it should be enough to use two different URLs, one of the <meta>
> tag and one for the action attribute in the form. Even if they actually
> point to the same file, the browser has no way to know.
>

Well that is the problem isn't it? The browser cannot KNOW. If I POST a
form to mypostingtarget.php and THAT comes back with a 'meta refresh'
statement THAT is the target that is going to be refreshed?.

I think there is no way out of it at the meta refresh level. The browser
cant know.

Only if you embed the refresh action within javascript, where you can
make the refresh action different from a form post.



>> The idea is to construct a not very real time view (5 minute granularity
>> is good enough) on some data, some of which the user can change.
>
> Well, that's the prototypical use case for AJAX :)
>

Yes.. but I have a bit of an instinctive dislike for Ajax..it seems to
be a hack to me, and if I am going that route I might as well use web
sockets. Which is designed to do this sort of thing. And do it better
than Ajax would,.


>> I haven't tested it to see if a refresh is actually different from a
>> submit.
>
> Oh, I thought you had. If the <meta> tag does not use POST, you don't
> have the problem in the first place.
>

well yes.

>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: simplexml adding 'encoding' attribute to xml declaration
Next Topic: strtotime() not able to handle 04/29 correctly???
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 23:37:54 GMT 2024

Total time taken to generate the page: 0.04438 seconds