I recently wrote a small AJAX-based chat program. The clients ping the server occasionally for new messages and update the view if a change has occurred. Simple.
Is it possible to do this entirely client-side? Could a set of loaded pages identify themselves to other users and send out updates to the other clients? How would this be accomplished? Could it be done entirely in Javascript?
Thanks for your thoughts on this!
Due to the same-origin policy, your JavaScript is not allowed to contact random third-party servers (or, consequently, other clients).
This is a fundamental part of the JavaScript security model.
The answer is, for better or for worse, that it cannot be done without going through the server or using Flash (which has a server-side way to relax the security).