html代码<body><span id="show_check"></span><br /> <span id="show_flag"></span><br /><script>var xmlhttp;if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safarixmlhttp=new XMLHttpRequest();}else{// code for IE6, IE5xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){document.getElementById("show_check").innerHTML=xmlhttp.responseText;var ajax=xmlhttp.responseText;alert(ajax[0].no1)}}xmlhttp.open("GET","22.php",true);xmlhttp.send();</script></body>---------------------------------------------------------------------------------------22.php代码<?php $info = array(array('no1'=>'bsd', 'no2'=>'wuddy', 'no3'=>'xie')); $userinfo = json_encode($info); echo $userinfo; ?>alert不出来json数据怎么回事呢
3 回答
- 3 回答
- 0 关注
- 1260 浏览
添加回答
举报
0/150
提交
取消