I want to continuously keep sending update to server using jquery. The interval will be almost nil.
What are the best way to do this? This is for updating the cursor position of once person on others screen. Practical implementation will be in a prototype of HTML5 whiteboard.
- What are the options available.
-
Which is the best way and what are
the implications.function send_position(){
//code to post
}
setInterval( “send_position()”, 10 );
Will this method be ok?
Either by using window.setTimeout() as described by Robert or, if you already use HTML5, you could use websockets: http://code.google.com/p/jquery-websocket/