[Javascript] Sumitting a selection every 4 seconds

Terry Riegel riegel at clearimageonline.com
Wed May 19 17:40:01 CDT 2004


On May 19, 2004, at 5:51 PM, Paul Novitski wrote:

> At 02:14 PM 5/19/2004, Terry Riegel wrote:
>> The select functionality is working, but what I can't figure out is 
>> how to delay before updating the right frame. (So if a user is 
>> selecting multiple items only one refresh on the server is needed)
>
>
> Terry,
>
> How about:
> - When a list selection is changed, the current time is posted 
> globally.
so on every change the global time variable would get reset to the 
instant of the change.


> - When the timer goes off, it performs its action only if more than N 
> seconds have elapsed since the last change.
>
Then when 3 seconds elapse check the global variable before submitting 
if the global is less then 3 seconds old don't submit.

That sounds good, but my Javascript is very weak. Any code snips would 
be very helpful.

> Do both these functions have to happen in the left frame?  Would the 
> problem be easier if the left frame posted selections (and the time of 
> the last change) and the right frame ran the timer to check on things?
>

Yes, they do. The right frame may not always contain the same code. I 
think even if I copuld do it this way I might be doinf a lot of 
unneccessary submits.


> Very nice page, by the way!
>

Thanks


> Paul
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list