2012-02-22 77 views

回答

0

使用JSON.stringify({你的对象这里})

0

JSON.stringify(jsonObject)会给你的JSONObject转换成字符串。它在大多数现代浏览器中都可用。为了向后兼容,您可以包括:JSON-js

0
**Check this out it will be helpful** 

//index.php 
<script type="text/javascript"> 
$(document).ready(function(){ 
var json1 = {"test1":"TEST1","test2":"TEST2","test3":"TEST3","test4":"TEST4"}; 
str = "data="+JSON.stringify(json1); 

$.get('test.php',decodeURI(str),function(html){ alert(html); },"html"); 
}); 

</script> 

//test.php 

echo $GET['data'];