request response from server
<p>this below my code can successful return json code.
but i cant request responce from server</p>

<pre><code>&lt;?php
include_once ('./AFactory.class.php');
$database= new AFactory;
$db=new AFactory();
$link=$db-&gt;getDBO();
$query=array('id'=&gt;NULL,'userCode'=&gt;$_POST['userCode']);
$sql=$db-&gt;insertQuery('`a_mis`.`users`',$query);
if ( mysql_query($sql) ) 
    {$data['success']=true;$data['message']='ok';}
else 
    {$data['success']=false;$data['message']='no';}

echo json_encode($data);

?&gt;
</code></pre>

<p>OUTPUT:</p>

<pre><code>{"success":true,"message":"ok"}
</code></pre>

<p>i'm using this code from localhost and send post to server.i cant get result from server</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script src="http://code.jquery.com/jquery-1.8.2.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function(){
        $.post("http://site.com/index.php",  {userCode:"ttt-ddd-fff"},
            function(data){  
                alert (data.message);
            },'json');  
});
&lt;/script&gt;
&lt;/head&gt;
&lt;/html&gt;
</code></pre>
