PHP脚本(AJAX正在调用它)(这是这个变量):
$name_and_id = $first_name . " " . $last_name . " (" . $row['id'] . ")";
传回来了:
$datarr = array();
$datarr[] = array('name_and_id' => $name_and_id);
echo json_encode($datarr);
JSON成功接受如下:
$.each(data, function(k, v){
v = v.name_and_id;
...
htmlStr += '<tr onclick="shrow(' + x + ',' + v + ',' + z + ')">'
... populates a div
这正确加载,但是当我点击tr
时请求没有完成...控制台说错误在v
...