代码如下A.html<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title><script type="text/javascript" src="jQuery.js"></script><script> $(function () { $.post("cx2.php", {name:'cx', number:'1'}, function(data){ alert(data.a); }, "json"); })</script></head><body> <h2>hhhhh</h2></body></html>——————————cx2.php<?php $name = $_POST['name']; $number = $_POST['number']; $arr = array('a'=>"tt", 'b'=>"tt2", 'c'=>"tt3"); print_r($arr);?>运行后得不到php里的数组,求大侠讲解一下,最好贴出修改后的代码
添加回答
举报
0/150
提交
取消