我已经在完美的代码中使用了ajax,并为我提供了我想要的json或数组作为输出。 我已经使用的代码是,如何将json/array从ajax responseText转换为javascript数组?
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","http://map_ajax_control.php",false);
xmlhttp.send();
var test = xmlhttp.responseText;
alert(test);
该测试变量给我JSON /阵列。
我想获得我在JavaScript数组中测试变量中收到的数据。
问题是,我如何解码JavaScript数组中的json数据? 我已经使用了代码,
var output = new Array();
output = json_decode(xmlhttp.responseText);
但是这个代码不给我任何输出。
我该怎么做这两件事?
拖累与整个jQuery库的web应用程序将是矫枉过正,如果这一切需要的是一个JSON AJAX处理 – ComethTheNerd 2014-09-13 12:13:16