I am developing a chat system. I want a new popup window to appear whenever a client try to contact another client. so how can I create a popup window to be opened on a certain event like when client receive a message.
I am using Django, Jquery.
thanks.
You might want to try using jQuery UI Chatbox Plugin. It provides a widget and is easy to integrate. http://www.cs.illinois.edu/homes/wenpu1/chatbox.html
Check out the accepted answer on this post:
How does Facebook chat avoid continuous polling of the server?
I think the Comet technique mentioned here would be best for your situation and could help you to avoid constant AJAX polling.
You could set up a Django view that worked as a client to a chat server, constantly listening, then it could close its connection and send the response to the browser (the hanging AJAX request) whenever a new event is received from the chat server.