Constructing a more efficient javascript user-based chat
<p>I am going to bed soon, so I will not be on until the morning, but I have been struggling with trying to find a javascript/jquery method that solves my problem.  I am trying to make a chat box feature where once a post is submitting it is then echoed back out and users on both ends can see it.  I know that I need to use javascript and or jquery.  Right now I am using a very inefficiency system: </p>

<pre><code>&lt;script language='javascript' type='text/javascript'&gt;
    setInterval( function() {
    $('#responsechat').load('echogetconversation.php?username=&lt;?php echo   $username; ?&gt;&amp;otherchatuser=&lt;?php echo $otherchatuser; ?&gt;');
    }, 100);
    &lt;/script&gt;
</code></pre>

<p>The only reason that I am using it is because it is the only way I know how to project new posts to both users.  I was wondering if someone knew a way to do this.  Once a post is submitted, it fades into a div and both users can see it, not only the user who submitted it, so it is like a facebook chat in a way.  I have no idea about any possible solutions, and have done research, but I could not find any that i could get to work.  Any help and/or insight to what I should do next would be appreciated.</p>
