代碼如下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里的數組,求大俠講解一下,最好貼出修改后的代碼
求教一道關于jquery里$.post()函數與php數組之間數據傳遞的問題?
守候你守候我
2018-12-06 19:24:13