javascript技巧2

字號:


    窗體事件綁定
    document.onmousedown=scrollwindow;
    元素
    document.窗體.elements[索引]
    對象綁定事件
    document.all.xxx.detachEvent('onclick',a);
    插件數(shù)目
    navigator.plugins
    取變量類型
    typeof($js_libpath) == "undefined"
    下拉框
    下拉框.options[索引]
    下拉框.options.length
    查找對象
    document.getElementsByName("r1");
    document.getElementById(id);
    定時
    timer=setInterval('scrollwindow()',delay);
    clearInterval(timer);
    UNCODE編碼
    escape() ,unescape
    父對象
    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"
    自動刷新
    <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>