jQuery 1.4 JSON problem
jQuery 1.4 JSON problem
I got a problem in json between jquery and php,codes is very simple, but it run error. see below:
*** JS: ***
$.post("/mix/getlist", { 'name' : item },
function(data){
alert(data.result);
}, "JSON");
*** PHP (codeigniter): ***
function getlist()
{
$arr = array('result' => $this->input->post('name'));
echo json_encode($arr);
}
JS throw a exception: data.result undefined, but it's ok on jQuery 1.3.2,and run error all above 1.4。
Who could help me ? 