Refresh page after a database entry without Javascript's setTimeout()

Isn't there a way where I can refresh the page right after a database new entry WITHOUT using Javascript setTimeout or setInterval?

Isn't there an AJAX function to do so? Or maybe a MySql function?

The only way is keep checking the database all the time? Doesn't it spend too much of the server?

My page will work like a Messenger.


You need to understand that what happens on the server and what happens on the client are completely separated, and while the client has a straight-forward way to contact the server, the converse is not true. There's no way any MySQL function could possibly refresh the browser on the client machine.

So polling (with ajax or similar) is frequently how this is done. However, it's not the only way. There are various "Comet" techniques, and of course the new web sockets initiative.

Need Your Help

windows.forms.panel calling onPaint twice

c# winforms panel onpaint

I have a panel with multiple panels inside of it. I have overridden OnPaint in the master panel to the following:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.