JavaScript コードの最後に function(xml) があります。
その中に console.log(xml) を書き、コンソール (開発者ツール) でデータの構造を確認できます。
デモのコードを変更したい場合は、データを同じ形式で記述する必要があります。
すべてのデータが使用されているわけではないため、コードを調べて正確に何が必要かを確認できます。それに基づいて、ajax 呼び出しを無効にし、データ オブジェクトを手動で作成できます。
例: http://jsfiddle.net/qLynjzds/
デモでデータがどのように機能するかの例 (2 ポイント):
var xml = {
credit: {
link: {
'@attributes': {
url: "http://www.yr.no/place/United_Kingdom/England/London/" //link for credits
}
}
},
location: {
country: "Country",
name: "City"
},
forecast: {
tabular: {
time: [{
'@attributes': {
from: "2015-05-28T14:00:00",
to: "2015-05-28T15:00:00"
},
symbol: {
'@attributes': {
'var': "01d",
name: "Clear sky"
},
},
temperature: {
'@attributes': {
value: "17"
},
},
precipitation: {
'@attributes': {
value: "0"
},
},
windDirection: {
'@attributes': {
deg: "252.6",
name: "West"
},
},
windSpeed: {
'@attributes': {
mps: "16.6",
name: "Strong breeze"
},
},
pressure: {
'@attributes': {
value: "1013.8"
},
}
}, {
'@attributes': {
from: "2015-05-28T15:00:00",
to: "2015-05-28T16:00:00"
},
symbol: {
'@attributes': {
'var': "01d",
name: "Clear sky"
},
},
temperature: {
'@attributes': {
value: "15"
},
},
precipitation: {
'@attributes': {
value: "1"
},
},
windDirection: {
'@attributes': {
deg: "252.6",
name: "West"
},
},
windSpeed: {
'@attributes': {
mps: "16.6",
name: "Strong breeze"
},
},
pressure: {
'@attributes': {
value: "1010.8"
},
}
}]
}
}
};