Application Remote

Application Remote

Good Day,

I would like to build an application which could be 'remotely controlled', so to speak, using jQuery.

Example, let's say I have a system setup to where a user on my website is reading a blog posting, and from my own computer, I change a setting on my site. How can I, using jquery, make my app 'listen' for those changes and act accordingly?

Right now I have a script checking every 5 seconds, setTimeout("function();", 5000);, to complete the task. Is this the right way to do it, or is there a better way to do it?

The function being called would call a PHP script which checks the MySQL database, and depending on if the value of a given field has changed, act.

Is there a way with jQuery, to have is 'listen' and have something 'trigger' the app to do something?

Kind of like how those 'live chat' applications work on a website, where an operator can trigger the site to provide a box where the end user can choose to talk now or ignore the chat request.

Thanks,
ChildOTK