jQuery ajax获取数据问题

程序片段如下:
var data_1;
$.post("getdata.php",function(string_1){
data_1 = string_1;
});
为什么string_1的内容无法被获取呢?_
要想获取其内容,应该如何做呢?麻烦指点下!
getdata.php:
<?php_
$con = mysql_connect('localhost','root');
mysql_select_db('my_db',$con);

$sql = 'SELECT * FROM data';
$result = mysql_query($sql);

//将数据存入数组
$sql_data = array();
while($row = mysql_fetch_array($result)){
    $sql_data[] = $row['data'];
}

echo json_encode($sql_data);

?>

$.post("getdata.php",function(string_1){
data_1 = string_1;
},"json");
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!