JS: cancel a pending page REFRESH if viewer types in TEXTAREA field
Posted on 2011-02-28
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