Anyone thoughts on Shoutbox?

I want to create a screambox, although I'm wondering if there is another way to get around this rather than using setInterval to query the database for new screams every few seconds. To be honest, I don't like it when you have to do that. Seems a little redundant, repetitive and just plain old, wrong. Not to mention the blinking screams when it grabs data.

So I am wondering how the professionals do it? I mean, I've seen screamboxes that surperb works and don't seem to use any setInterval or setTimeout javascript functions to do this.

Can anyone suggest any ideas or approach to this that doesn't use setInterval or setTimeout ??

Thanks:)

+2


a source to share


3 answers


Use javascript to refresh crix as people write posts without reloading the whole page. Take a look at this code as an example. (The download link is on the right). There are many other scream examples that use Javascript to seamlessly output new screams from the database all over the internet. Many of them are highly customizable, so you can change the CSS to achieve the style you want.



Here are some more examples of such scripts:
http://www.ajaxdaddy.com/demo-jquery-shoutbox.html
http://www.truefusion.org/TFsBOX/ (The code is here: http://code.google.com / p / tfsbox / )

+1


a source


Perhaps you can use COMET ?



HTML5 will allow websockets with javascript, which will make it even better, but I wouldn't use HTML 5 for this until more people are switching to browsers that support it.

0


a source


Instead of using timers, set the refresh button to have users manually refresh posts, cbox do this.

0


a source







All Articles