Hi,
please try it like this:

setInterval("retrieveData()", 1000);

Did that work?

Thanks,
Teo

On Tue, Dec 16, 2008 at 5:47 PM, Ciel Bleu <[email protected]> wrote:

>
> HI,
>
> I tried using the setInterval in my view_open() function but by view
> is not refreshing.
>
> here's my code in my main.js:
>
> function view_onOpen() {
>        setInterval( retrieveData(), 1000);
> }
>
> function retrieveData() {
>  var request = new XMLHttpRequest();
>  request.onreadystatechange = onReadyStateChange;
>
>  try {
>    request.open('GET', 'http://localhost/xmlhttprequest/query.php',
> false);
>    request.send();
>  }
>        catch(e) {
>                view.alert("ERROR!");
>  }
>
>  function onReadyStateChange() {
>    if (request.readyState != 4) {
>      return;
>    }
>
>    if (request.status == 200) {
>                        label1.innerText = "You have
> ("+request.responseText+") New
> Orders";
>    }
>        request = null;
>  }
> }
>
>
> my php scripts echo's the number of entries found in my database. My
> script is working fine. It echo's the value correctly.
>
> My problem is with the gadget. When google desktop first loads the it
> display's correctly but after the indicated interval. It's not
> updating (of course there's changes in the db).
>
> Hope you could help me. This is my first widget and want it to be
> fully functional.
>
> *^_^* Thanks and Advance Merry Christmas!
>
> Ciel Bleu
>
> >
>


-- 
Teo (a.k.a. Teominator a.k.a. Teodor Filimon)
site www.teodorfilimon.com | blog www.teodorfilimon.blogspot.com
GMT +2

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to