dongyisa6254 2015-06-04 11:45
浏览 30

将数组传递给jquery函数

I am want to pass an array as a parameter of a jquery function. When I alert the array I get function Array() { [native code] }

this error I tried this in php. Here Sql functions are self written. They are good for sure. And throughout this loop I am printing the data from data table. Which works. Now I want to show other thing when button is clicked.

$i=0;
for(;$i<Sql_Num_Rows($result);$i++) {
$row=  Sql_fetch_array($result);
$j = 0;
$data[$i][$j++] = $row['user_id'];
$data[$i][$j++] = $row['first_name'];
$data[$i][$j++] = $row['last_name'];
$data[$i][$j++] = $row['user_address'];
$data[$i][$j++] = $row['user_phone'];;
$data[$i][$j++] = "<button onclick='update_user_info($row)'>detail</button>";
}

And this in javascript

function update_user_info(user_info)
{
  alert(user_info)
}

can anyone help me how can I get the array with value. array has value like $row['name'],$row['email']..... I need these values. Please help

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 stata安慰剂检验作图但是真实值不出现在图上
    • ¥15 c程序不知道为什么得不到结果
    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题