willsherwood
asked on
JS: cancel a pending page REFRESH if viewer types in TEXTAREA field
We have the following header refresh to auto-refresh after 10 minutes,
<meta http-equiv="refresh" content="600" />
but we want to cancel that refresh if focus (click into) is set to the main textarea on the page (thus a refresh would not seemingly asynchronously foil the viewer's in-progress typing into the textarea prior to SUBMITting).
1. Is there a JS way to undo the header tag?
2. (if not) is there an alternate way to set a countdown in JS that refreshes on timeout, and thus clicking into the textarea could cancel that countdown somehow
<meta http-equiv="refresh" content="600" />
but we want to cancel that refresh if focus (click into) is set to the main textarea on the page (thus a refresh would not seemingly asynchronously foil the viewer's in-progress typing into the textarea prior to SUBMITting).
1. Is there a JS way to undo the header tag?
2. (if not) is there an alternate way to set a countdown in JS that refreshes on timeout, and thus clicking into the textarea could cancel that countdown somehow
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yup, my mistake on that line, you noticed it well. Thanks for the points.
Regards
Regards
ASKER
one clarification: in order to stop the refreshing once focus was there, i think in the textarea i would want a call to cto() . does that make sense to use cto() instead of RefreshPage() ?
thanks