3 messages in com.googlegroups.google-gearsRe: [google-gears] Re: Timed Save Fields
FromSent OnAttachments
Amin18 Jun 2007 05:39 
Marcin Jaworski18 Jun 2007 06:17 
Scott Hess18 Jun 2007 09:10 
Subject:Re: [google-gears] Re: Timed Save Fields
From:Scott Hess (scot@gmail.com)
Date:06/18/2007 09:10:22 AM
List:com.googlegroups.google-gears

You might also consider registering the onchange event for the field.

-scott

On 6/18/07, Marcin Jaworski <mrja@gmail.com> wrote:

This is possible of course.

You can use setTimeout:

var textField = document.getElementById('YourInputID"); doSomethingWithTextField = function() { alert(element.value); setTimeout(doSomethingWithTextField, 10000); }

or setInterval:

var textField = document.getElementById('YourInputID"); doSomethingWithTextField = function() { alert(element.value); }

var timer = setInterval(doSomethingWithTextField, 10000);

The timer variable in the second example is an interval object which can be used to stop executing interval with clearInterval function:

clearInterval(timer);

On 18 Cze, 14:40, Amin <supe@gmail.com> wrote:

I'm new to JavaScript and do not really know its capabilities. Suppose I have a website with a text field in it. I was wondering if it would be possible to set up a timer and use Google Gears to save whatever is in the text field every, say, 10 seconds? If someone could tell me if this is possible and if so, what code would be associated with the timer. Thanks.