http://www.aygfsteel.com/ebecket 返還網(wǎng)
          隨筆-140  評(píng)論-11  文章-131  trackbacks-0

          類(lèi)型轉(zhuǎn)換:parseInt\parseFloat\toString

          類(lèi)型判斷:typeof;eg:if(typeof(var)!="undefined")\isNaN

          字符處理函數(shù):toLowerCase\touppercase\ 
          substring(從哪里截到哪)\substr(從哪里開(kāi)始;截多少個(gè)字符) \indexOf(字串中找某串字符)\replace(替換函數(shù))\
          charCodeAt
          concat
          split
          join

          定時(shí)處理函數(shù):setInterval;setTimeout;clearTimeout;clearInterval

          兩個(gè)顯示控制屬性:visibility(hidden,hide,show,visible);display(none,block,inline)

          編碼的一些函數(shù):escape();

          取得對(duì)象的方法:
          document.getElementsByTagName(根據(jù)標(biāo)簽名獲得對(duì)象組)\
          document.getElementsByTagName('head').item(0)
          document.getElementsByName(通過(guò)NAME獲得對(duì)象)\
          document.getElementById(通過(guò)ID獲得對(duì)象)\
          document.form1.f1\
          document.all.tags(t)[id]
          document.all[id]
          document.layers[id]

          不常用的一些方法:
          moveToAbsolute:
          fromElement
          toElement
          contains
          captureEvents
          parent.frames
          moveTo(x,y)
          resizeBy(x,y)
          resizeTo(x,y)
          attachEvent('onmousedown',showHide);
          document.createElement('')
          document.createTextNode('')
          obj.setAttribute('src','')
          obj.getAttribute('')
          event.srcElement
          style.cssText
          document.body.appendChild
          document.body.removeChild
          document.body.insertAdjacentHTML("AfterBegin",s)
          innerHTML/
          removeNode
          insertBefore
          arguments
          event.keyCode

          正則相關(guān):RegExp(eg:new RegExp("\"","g"))

          一些長(zhǎng)寬及位置屬性:
          window.innerHeight
          window.innerWidth
          document.documentElement.clientWidth
          document.documentElement.clientHeight
          document.body.clientWidth
          document.body.clientHeight
          document.body.offsetWidth
          document.body.offsetHeight
          document.body.scrollLeft
          document.body.scrollTop
          document.location.reload()

          window一些方法:
          window.onerror=function(){return true;}隱去報(bào)錯(cuò)
          window.onload\window.onunload
          window.status
          window.parent.location.href
          window.location.href
          window.top.location.href

          數(shù)學(xué)方法:
          Math.max

          數(shù)組方法:
          length
          slice

          JS輸出方法:
          document.write(s);
          alert(s);
          confirm
          prompt
          document.writeln
          彈窗方法:
          window.showModalDialog(<url>,<標(biāo)題>,<屬性>)
          window.open("","","");


          附:常用DOM方法和屬性(即必須掌握部分)

          創(chuàng)建節(jié)點(diǎn):createElement();createTextNode()
          復(fù)制節(jié)點(diǎn):cloneNode()
          插入節(jié)點(diǎn):appendChild();insertBefore()
          刪除節(jié)點(diǎn):removeChild()
          替換節(jié)點(diǎn):replaceChild()
          設(shè)置節(jié)點(diǎn)屬性:setAttribute()
          查找節(jié)點(diǎn):getAttribute();getElementById();getElementsByTagName();hasChildNodes
          節(jié)點(diǎn)的屬性:nodeName;nodeType;nodeValue
          遍歷節(jié)點(diǎn)樹(shù):childNodes;firstChild;lastChild;nextSibling;parentNode;previousSibling

          posted on 2009-10-28 13:52 becket_zheng 閱讀(163) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): 網(wǎng)頁(yè)web前端技術(shù)
          主站蜘蛛池模板: 鹤峰县| 古交市| 昆山市| 萍乡市| 深圳市| 克东县| 吉林市| 奎屯市| 丰都县| 凤城市| 五大连池市| 从化市| 剑阁县| 治多县| 新竹县| 沁水县| 徐水县| 旅游| 鲁甸县| 清镇市| 南部县| 吉水县| 大宁县| 玉溪市| 广州市| 延庆县| 昭平县| 牙克石市| 庆云县| 新疆| 石渠县| 辽宁省| 岳阳市| 阿拉善盟| 永川市| 定西市| 齐齐哈尔市| 玛沁县| 鄂托克前旗| 江津市| 合川市|