js读取本地json文件数据 js怎么加载&解析json文件,原生的?
js怎么加载&解析json文件,原生的?<script language=“javascript”>function getjson(){var xmlReq try{xmlReq=new A
js怎么加载&解析json文件,原生的?
<script language=“javascript”>function getjson(){var xmlReq try{xmlReq=new ActiveXObject()Microsoft.XMLHTTP)var web=”1。JSON“//JSON文件路径//异步模式xmlReq.open打开(“GET”,web,true)xmlReq.onreadystatechange文件=函数(){如果(xmlReq.readystate文件== 4){ 文档.写入( xmlReq.responseText文件)//对JSON文件的操作}xmlReq.send发送()catch(e){alert(e)}}</script>