/* RSS 阅读器 */ /* DisplayModule interface. */ var DisplayModule = new Interface('DisplayModule', ['append', 'remove', 'clear']); /* ListDisplay class. */ var ListDisplay = function(id, parent) { // implements DisplayModule this.list = do...
/* XHR工厂 */ /* AjaxHandler interface. */ var AjaxHandler = new Interface('AjaxHandler', ['request', 'createXhrObject']); /* SimpleHandler class. */ var SimpleHandler = function() {}; //implements AjaxHandler SimpleHandler.prototype = { r...
/* 简单工厂 */ /* BicycleShop class */ var BicycleShop = function() {}; BicycleShop.prototype = { sellBicycle: function(model) { var bicycle; switch(model) { case 'The SpeedSter': bicycle = new SpeedSter(); break; case 'The Lowrider': bicy...
//Include syntactic sugar to help the development of out interface. Function.prototype.method = function(name, fn){ this.prototype[name] = fn; return this; }; (function(){ function _$(els){ //... } /* Events * addEvent * getEvent */ _$.met...
/* 方法的调用链 */ (function(){ function _$(els){ this.elements = []; for(var i=0,len = els.length ;ilen; ++i){ var element = els[i]; if (typeof element === 'string') { element = document.getElementById(element); } this.elements.push(eleme...
一、bgColor属性 ...... function change(color) { document.bgColor=color ; } ...... SPAN onMouseOver="change('red')"变红色/SPAN SPAN onMouseOver="change('blue')"变蓝色/SPAN SPAN onMouseOver="change('yellow')"变黄色/SPAN ...... // onMouseOve...
版面上有一个button,一个div,单击button,div中显示当前日期 答案: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http://www.w3.org/1999/xhtml" head title无标...
1. setInterval() 用法_学习 //每隔一秒自动执行方法 var c=0; function showLogin() { alert(c++); } //setInterval方法或字符串 ,毫秒,参数数组(方法的)) setInterval("showLogin()","1000"); 2.setTimeout setTimeout()在js类中的使用方法 setTimeout...
关于在jsp页面返回上一页有很多方法,百度下就很多,不过我今天在写测试时发现也得注意些地方 例如:1、window.location='uri'; 2、window.location.href='url'; 3、window.history.back(); 但他们有些区别,1、2都是转向到指定的url,这个url是你确定的前一...