JQuery Ajax returned blank data
<p>I am learning how to use JQuery to help check data availability.</p>

<p>I have written a function in a Controller for checking data input, and the URL is like this:
<a href="http://www.mywebsite.com/controllers/action/avariable" rel="nofollow">http://www.mywebsite.com/controllers/action/avariable</a></p>

<p>But the returned data was blank.   </p>

<pre><code>&lt;script language="javascript"&gt; 
    $(document).ready(function(){  
        $(document).change(function(){ 
            var usr = $("#data\\[User\\]\\[name\\]").val();
            $.post{"http://www.mywebsite.com/controllers/action/",
                usr,
                function(msg){alert(msg);}
            }
        });
    });   
&lt;/script&gt;

&lt;div id="username"&gt;
    &lt;input type=text name="data[User][name]" id="data[User][name]"&gt;
&lt;/div&gt;             
</code></pre>

<p>Here is the code of the Action:</p>

<pre><code>function action($data=null){
    $this-&gt;autoRender = false;
    $result2=$this-&gt;__avail($data);           
    if($result2==1)
        {return "OK";}
    else
        {return "NOT";}           
}
</code></pre>
