2006/04/29

衛星雲圖修正

因為中央氣象局的網頁由V4升級到V5
因此舊的Scrip也就不能使用了
衛星雲圖程式更新提供了新的code

<script>
var type = "1";
var url = "";
function menu() {
if (type == "1") type = "3";
else if (type == "3") type = "0";
else type = "1";
map(type);
}

function map(type) {
var d = new Date();
var da = d.getDate();
if (da<10) da = '0'+da;
var m = d.getMonth()+1;
if (m<10) m = '0'+m;
var h = d.getHours()-1;
if (h>21) h=21;
if (h<10) h = '0'+h;
var y = d.getYear(); if (y < 2000) y += 1900;
url = "http://www.cwb.gov.tw/V5/observe/satellite/Data/s"+type+"p/s"+type+"p-"+ h+'-'+da+'-'+m+'-'+ y + ".jpg"; document.getElementById('SPAN1').innerHTML = "<img src="+url+" width='190px' height='190px' " +
" oncontextmenu='menu();return false;'/>";
}
</script>

<a href='http://www.cwb.gov.tw/V5/observe/satellite/sat.htm' target='_blank' title='按左鈕連氣象局雲圖網站;按右鈕換圖'>
<span id='SPAN1'> </span></a>
<script> map(type);</script>

不過我現在將連結都拉到YAM的網站上去
直接使用固定的衛星雲圖來用
就不需要Java Script了

0 comments:

 
Back to Top
This Site Power by JoStudio. Some Rights Reserved.