Hi,
I'm trying to build a small and simple chat using MySQL, PHP and
jQuery.

What I'm doing is that every two seconds (--> setInterval) I call (-->
$.ajax) a php code that will echo the 20 most recent posts (stored in
the db) to the "success" option of the $.ajax function. This happens
even if there was no new message added to the db within the 2 seconds.

It works perfectly using FF on macs and PCs and with Chrome!.

Safari however seems to stop calling the $.ajax function after a
finite number of times. I wrote a test code that increments a counter
every time the posts are (re)loaded on the page. After several tests
Safari seems to stop reloading the posts after a random number of
times (it ranged from 9 to 46 reloads).

What is the underlying problem? Is it the timer itself or the
combination of setInterval and $.ajax? I'm really lost.

Here is the link to the test page http://www.28prod.be/timerTest/betae/
(don't pay attention to the posts it's just a test)
Also, Safari bugs only when the code is on the web, it works perfectly
when run locally.

Thanks for your help,
Clem.

Reply via email to