Well, i know a way:<br><br>function verify(){ <br> var delay = 1800; //i guess it's 1 minute <br> getmsgs = setTimeout(fn_getmsg, delay);<br>}<br><br>function fn_getmsg(){<br> //ajax request<br> //get the result<br>
//if result > 0<br> //echo the result or any info...<br>}<br><br>so, u just have to know the basic of ajax...<br>a simple GET should work...<br><br>I suggest u to meet jQuery.com An amazing js library... only 16k<br>
<br><br><div><span class="gmail_quote">2006/8/28, Flávio Gomes <<a href="mailto:flavio@economisa.com.br">flavio@economisa.com.br</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/> Is it as simple as just setting a timer function that triggers my<br>function?<br>> Or is it any drawbacks with doing that? Is other scripts available<br>during this time?<br><br>/Never played with AJAX, but I believe that "Yes, it's just that simple".
<br><br>Try it and tell us.<br><br>Peter Lauri escreveu:<br><br>> Best group members,<br>><br>><br>><br>> I have a site where I have an internal message system. With this I<br>> want to add functionality so that when a user have a new message, an
<br>> alert box will show up with that information.<br>><br>><br>><br>> What the script actually would do is to every minute connect execute a<br>> script that use AJAX to retrieve the number of unread messages, and
<br>> then alert if it is more then the last time.<br>><br>><br>><br>> I want to have a script that does not effect other scripts on the site.<br>><br>><br>><br>> Is it as simple as just setting a timer function that triggers my
<br>> function? Or is it any drawbacks with doing that? Is other scripts<br>> available during this time?<br>><br>><br>><br>> Best regards,<br>><br>> Peter Lauri<br>><br>><br>><br>><br>
><br>><br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________<br>>Javascript mailing list<br>><a href="mailto:Javascript@LaTech.edu">
Javascript@LaTech.edu</a><br>><a href="https://lists.LaTech.edu/mailman/listinfo/javascript">https://lists.LaTech.edu/mailman/listinfo/javascript</a><br>><br>><br><br>--<br>Flavio Gomes<br><a href="mailto:flavio@economisa.com.br">
flavio@economisa.com.br</a><br><br>_______________________________________________<br>Javascript mailing list<br><a href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</a><br><a href="https://lists.LaTech.edu/mailman/listinfo/javascript">
https://lists.LaTech.edu/mailman/listinfo/javascript</a><br></blockquote></div><br>