?? weatherforecast.js
字號:
var weatherForecastIntervalID = 0;function updateWeatherForecast() { var ajaxRequest = new AjaxRequest("UpdateWeatherForecast"); ajaxRequest.addFormElementsById("forecastZipCode"); ajaxRequest.sendRequest();}function handleZipCodeChange() { var zipCode = document.getElementById("forecastZipCode").value; if(isValidZipCode(zipCode)) { updateWeatherForecast(); startWeatherUpdateInterval(); } else { if(weatherForecastIntervalID != 0) { window.clearInterval(weatherForecastIntervalID); weatherForecastIntervalID = 0; } }}function startWeatherUpdateInterval() { weatherForecastIntervalID = window.setInterval("updateWeatherForecast()", 300000);}function isValidZipCode(zip) { if(zip.length == 5 && isAllDigits(zip)) { return true; } return false;}function isAllDigits(argvalue) { argvalue = argvalue.toString(); var validChars = "0123456789"; var startFrom = 0; for (var n = startFrom; n < argvalue.length; n++) { if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) { return false; } } return true;}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -