jQuery $.post() doubt!
<p>I'm trying to use POST to pass variables to chat.php from try.htm</p>

<p>The code for try.htm is : </p>

<pre><code>&lt;head&gt;
&lt;script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type = "text/javascript"&gt;
     function yo() {
       var text = $("#msg").val();
       $.post("chat.php",msg:text);
     }
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;input type="text" id="msg" onkeyup="yo()"&gt;
&lt;div id="display"&gt;Change&lt;/div&gt;            
&lt;/body&gt;
</code></pre>

<p>The code for chat.php is : </p>

<pre><code>&lt;?php
$msg=$_POST['msg'];
mysql_connect("localhost","root");
mysql_select_db("user");
mysql_query("INSERT INTO user (name,pwd,status) VALUES ('$msg','work','0')") or die(mysql_error());
?&gt; 
</code></pre>

<p>The problem is that the 'msg' variable doesn't seem to be getting passed onto chat.php!
What's wrong ?</p>
