setTimeout

T

Todd Anderson

I have a live support script that uses setTimeout to refresh the page so
that users will see new postings as they are added.
But the refresh makes it hard to type new text in as when the page
refreshes the text you're typing is lost.
So i have a javascript that when you place your cursor in the text field
it resets the setTimeout to a longer refresh, but it's not resetting it.
Any help is appreciated and thanks in advance.

<SCRIPT LANGUAGE="Javascript">

<!--
function disable_refresh()
{
window.setTimeout("location.href='MY.html'",100000000)
}
function refresh()
{
window.setTimeout("location.href='MY.html'",10000)
}
//-->

</SCRIPT>

<BODY onLoad="refresh()"> THIS SETS THE REFRESH RATE

<input type="text" name="question" size="50"
onkeyup="javascript:disable_refresh()" > THIS DISABLES THE REFRESH OR
MAKES IT LONGER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top