<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试文档</title>
<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
</head>
<body>
<script language="javascript" type="text/javascript">
function getjs()
{
$.getJSON("aaa.php?module=yes&rid="+Math.random(),{ids:[111,222,333,444,555].join(",")},function(data){
for(var i=0;i<data.length;i++){
alert(data[i].id);
}
});
}
</script>
<input type="button" value="测试" onClick="javascript:getjs();"/>
</body>
</html>
<?php
$ids=$_GET["ids"];
$ids=explode(',',$ids);
//$arr=array("name"=>"姓名", "age"=>20,'A'=>$ids);
$arr=array();
$arr[]=array('id'=>$ids[0],'price_now'=>'0.00','time_now'=>'161427','u_name_now'=>'abc','state'=>'1','bidDisabled'=>'0');
$arr[]=array('id'=>$ids[1],'price_now'=>'0.00','time_now'=>'161427','u_name_now'=>'abc','state'=>'1','bidDisabled'=>'0');
$arr[]=array('id'=>$ids[2],'price_now'=>'0.00','time_now'=>'161427','u_name_now'=>'abc','state'=>'1','bidDisabled'=>'0');
$arr[]=array('id'=>$ids[3],'price_now'=>'0.00','time_now'=>'161427','u_name_now'=>'abc','state'=>'1','bidDisabled'=>'0');
$arr[]=array('id'=>$ids[4],'price_now'=>'0.00','time_now'=>'161427','u_name_now'=>'abc','state'=>'1','bidDisabled'=>'0');
$jarr=json_encode($arr);
echo $jarr;
?>
|