【发布时间】:2013-11-16 11:52:53
【问题描述】:
嗨,我正在尝试将此 JSON 存储到我的 javascript 数组中。有什么办法可以做到这一点。我使用以下代码,但它根本不起作用。
我的 json JSON
[{"id":"1","Intensity":"1","Location":"12.48,77.26"},{"id":"2","Intensity":"2","Location":"12.47,77.26"},{"id":"3","Intensity":"2","Location":"12.47,77.27"},{"id":"4","Intensity":"2","Location":"12.46,77.24"},{"id":"5","Intensity":"2","Location":"12.44,77.24"},{"id":"6","Intensity":"2","Location":"12.44,77.28"},{"id":"7","Intensity":"2","Location":"12.50,77.28"},{"id":"8","Intensity":"2","Location":"12.45,77.30"},{"id":"9","Intensity":"2","Location":"12.41,77.21"}]
我用 JS 获取 json 数据的 html 代码
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.min.js"></script>
</head>
<body>
<div id="response">werer</div>
<script>
$.get('http://zonewebs.org/website/naveen/source/location.php', function(data) {
$('#response').append(data);
});
</script>
</dody>
</html>
【问题讨论】:
标签: javascript php html arrays json