javascript技巧2

字號(hào):


    窗體事件綁定
    document.onmousedown=scrollwindow;
    元素
    document.窗體.elements[索引]
    對(duì)象綁定事件
    document.all.xxx.detachevent('onclick',a);
    插件數(shù)目
    navigator.plugins
    取變量類型
    typeof($js_libpath) == undefined
    下拉框
    下拉框.options[索引]
    下拉框.options.length
    查找對(duì)象
    document.getelementsbyname(r1);
    document.getelementbyid(id);
    定時(shí)
    timer=setinterval('scrollwindow()',delay);
    clearinterval(timer);
    uncode編碼
    escape() ,unescape
    父對(duì)象
    obj.parentelement(dhtml)
    obj.parentnode(dom)
    交換表的行
    tableid.moverow(2,1)
    替換css
    document.all.csss.href = a.css;
    并排顯示
    display:inline
    隱藏焦點(diǎn)
    hidefocus=true
    根據(jù)寬度換行
    style=word-break:break-all
    自動(dòng)刷新
    <meta http-equiv=refresh content=8;url=http://www.forasp.cn>
    簡單郵件
    <a href=mailto:aaa@bbb.com?subject=ccc&body=xxxyyy>
    快速轉(zhuǎn)到位置
    obj.scrollintoview(true)
    錨
    <a name=first>
    <a href=#first>anchors</a>