[Javascript] Background script

Rafael Santos shanex.fael at gmail.com
Mon Aug 28 15:16:23 CDT 2006


Well, i know a way:

function verify(){
  var delay = 1800; //i guess it's 1 minute
  getmsgs = setTimeout(fn_getmsg, delay);
}

function fn_getmsg(){
   //ajax request
   //get the result
   //if result > 0
   //echo the result or any info...
}

so, u just have to know the basic of ajax...
a simple GET should work...

I suggest u to meet jQuery.com An amazing js library... only 16k


2006/8/28, Flávio Gomes <flavio at economisa.com.br>:
>
> /> Is it as simple as just setting a timer function that triggers my
> function?
> >  Or is it any drawbacks with doing that? Is other scripts available
> during this time?
>
> /Never played with AJAX, but I believe that "Yes, it's just that simple".
>
> Try it and tell us.
>
> Peter Lauri escreveu:
>
> > Best group members,
> >
> >
> >
> > I have a site where I have an internal message system. With this I
> > want to add functionality so that when a user have a new message, an
> > alert box will show up with that information.
> >
> >
> >
> > What the script actually would do is to every minute connect execute a
> > script that use AJAX to retrieve the number of unread messages, and
> > then alert if it is more then the last time.
> >
> >
> >
> > I want to have a script that does not effect other scripts on the site.
> >
> >
> >
> > Is it as simple as just setting a timer function that triggers my
> > function? Or is it any drawbacks with doing that? Is other scripts
> > available during this time?
> >
> >
> >
> > Best regards,
> >
> > Peter Lauri
> >
> >
> >
> >
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Javascript mailing list
> >Javascript at LaTech.edu
> >https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> >
>
> --
> Flavio Gomes
> flavio at economisa.com.br
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060828/20d06e22/attachment.htm>


More information about the Javascript mailing list