js无法post关联数组到php?index.htm代码:<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
function hello(){
arr=[];
arr["a"]=["1","2"];
arr["b"]=["hello","world"];
$.ajax({
url:"laji.php",
type:"post",
data:{
arr:arr
},
success:function(d){
alert(d);
}
})
}
function hello2(){
arr=[];
arr[0]=["1","2"];
arr[1]=["hello","world"];
$.ajax({
url:"laji.php",
type:"post",
data:{
arr:arr
},
success:function(d){
alert(d);
}
})
}
</script>
<button onclick="hello()">hello</button>
<button onclick="hello2()">hello2</button>laji.php代码:<?php
$arr=$_POST["arr"];
print_r($arr);
?>运行hello1()出错运行hello2()正常
怎么样才能传送关联数组?