YUI(Yahoo! UI Library) 分兩塊:JS和CSS,JS又含分為兩類:工具包(YUI Utilities)和控件庫(kù)(YUI Widgets),具體的,看developer.yahoo.com/yui/examples/
一般使用的話,直接用utilities.js好了
The utilities.js file rolls up all of the YUI utility components into a single
file; it includes the following components:
* Yahoo Global Object
* Event
* Dom
* Connection Manager
* Animation
* Drag & Drop
* Element
就是包含了工具包里的基本的幾個(gè)工具js
順手記一個(gè)js的prototype屬性,YUI里也經(jīng)常用到。
var F1 = function(param) {
this.testNum = param;
}
var F2 = function(param) {
this.testStr = param;
}
var a = new F1(25);
F2.prototype = a;
var b = F2('hello');
這個(gè)時(shí)候b還沒有testNum這個(gè)property。
如果var c = b.testNum; 這時(shí)prototype鏈發(fā)生作用,使b有了testNum這個(gè)property。
如果設(shè)置b.testNum = 30; 那么只改變了b.testNum,而沒有改變a.testNum。
好像就是繼承關(guān)系?
誰(shuí)知道F1 || {} 是什么意思?
再記個(gè)JS的dom方法:
1.刪除節(jié)點(diǎn):node.parentNode.removeChild(node)
2.增加節(jié)點(diǎn):document.createElement('div');
posted on 2007-11-25 21:58
EvanLiu 閱讀(495)
評(píng)論(0) 編輯 收藏 所屬分類:
JS