后端代码
$sql=mysql_query("select number,decode from hongbao order by rand() limit 1 ");
$row=mysql_fetch_array($sql);
$_SESSION['ip']=$_POST['ip'];
$data['number']=$row['number'];
$data['decode']=$row['decode'];
echo json_encode($data);
?>
前端代码
$(document).ready(function(){
$(".red").click(function(){
$(this).addClass("shake");
setTimeout(function(){
$(".red").removeClass("shake");
$.post(
"recive.php",
{ip:$("#ip").val()},
function(data){
$(".windows").fadeIn();
$("#number").attr("value",dada.number);
$("#decode").attr("value",data.decode);
$(".opacity").fadeIn();
}
)
},2000);
});
$(".close").click(function(){$(this).parent().fadeOut();$(".opacity").fadeOut()})
});
返回数据那里是不是写错了,求大神分析···