以下是JSON鏈接。 http://api.wunderground.com/api/c3d8a6a640832fd0/conditions/forecast/alert/q/29.9205347,73.8706849.json在HTML中使用JSON腳本並顯示數據
此JSON文件提供有關天氣
數據,我想將此數據,通過上面的鏈接給出了我的HTML文件。我第一次使用JSON。所以我需要幫助將這個JSON文件鏈接到我的HTML文檔。
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>
</head>
<body>
<div class="wrapper">
<span id="temp"></span>
<span id="high"></span>
<span id="low"></span>
<span id="windspeed"></span>
<span id="description"></span>
<span id="city"></span>
<span id="iconorimage"></span>
<span id="time"></span>
<span id="any thing else"></span>
</div>
</body>
</html>
我沒關係,如果我可以只顯示溫度,城市,天氣圖標[下雨,晴天],關於天氣,高/低,風速和時間的文字說明。
看,我只是不知道如何抓住這一個單一的東西來自html的數據,一旦我變得能夠從我的html文件訪問這個數據,休息我會做我自己 –