📄 weatherwidget.js
字号:
function AjaxWeatherWidget(oElement) {
this.element = (oElement)?oElement:document.body;
this.lastModified = null;
this.getWeather();
}
AjaxWeatherWidget.prototype.getWeather = function () {
var oThis = this;
var doTimeout = function () {
oThis.getWeather();
};
var oReq = zXmlHttp.createRequest();
oReq.onreadystatechange = function () {
if (oReq.readyState == 4) {
if (oReq.status == 200) {
var lastModified = oReq.getResponseHeader("Weather-Modified");
if (lastModified != oThis.lastModified) {
oThis.lastModified = lastModified;
oThis.element.innerHTML = oReq.responseText;
}
}
}
};
oReq.open("GET", "weather.aspx", true);
oReq.send(null);
setTimeout(doTimeout,60000);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -