我从 2 天开始就遇到了这个问题,我需要使用 javascript 从下面的 url 获取数据。
http://www.apexweb.co.in/Apex_Quote/Download_Data.asp?un=9393910169
我解析了静态数据,但我需要解析来自 url 的数据。帮我
var employees = [{"ContactName":"AksharmaDelhi","ContactNumber":"9313146690","MainCategory":"NONLOCAL","SubCategory":"LIG"},
{"ContactName":"AbhijeetPune","ContactNumber":"9271263359","MainCategory":"NONLOCAL","SubCategory":"LIG"},
{"ContactName":"Abhinandan","ContactNumber":"9954534007","MainCategory":"NONLOCAL","SubCategory":"LIG"},
{"ContactName":"Abhishek","ContactNumber":"9302172932","MainCategory":"NONLOCAL","SubCategory":"LIG"},
{"ContactName":"AbhishekPuri","ContactNumber":"9303928233","MainCategory":"NONLOCAL","SubCategory":"LIG"},
{"ContactName":"AbhishekZhakkas","ContactNumber":"9863027167","MainCategory":"NONLOCAL","SubCategory":"MIG"},
{"ContactName":"Abin","ContactNumber":"8891886340","MainCategory":"NONLOCAL","SubCategory":"MIG"},
{"ContactName":"AccountantSrinivas","ContactNumber":"9949861074","MainCategory":"LOCAL","SubCategory":"MIG"},];
alert(employees.length); //get length
for(var i = 0;i<employees.length;i++){
alert(employees[i].ContactName + employees[i].ContactNumber + employees[i].MainCategory + employees[i].SubCategory);
}
</script>