http://www.aygfsteel.com/ebecket 返還網
          隨筆-140  評論-11  文章-131  trackbacks-0

          類型轉換:parseInt\parseFloat\toString

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

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

          定時處理函數:setInterval;setTimeout;clearTimeout;clearInterval

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

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

          取得對象的方法:
          document.getElementsByTagName(根據標簽名獲得對象組)\
          document.getElementsByTagName('head').item(0)
          document.getElementsByName(通過NAME獲得對象)\
          document.getElementById(通過ID獲得對象)\
          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

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

          一些長寬及位置屬性:
          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;}隱去報錯
          window.onload\window.onunload
          window.status
          window.parent.location.href
          window.location.href
          window.top.location.href

          數學方法:
          Math.max

          數組方法:
          length
          slice

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


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

          創建節點:createElement();createTextNode()
          復制節點:cloneNode()
          插入節點:appendChild();insertBefore()
          刪除節點:removeChild()
          替換節點:replaceChild()
          設置節點屬性:setAttribute()
          查找節點:getAttribute();getElementById();getElementsByTagName();hasChildNodes
          節點的屬性:nodeName;nodeType;nodeValue
          遍歷節點樹:childNodes;firstChild;lastChild;nextSibling;parentNode;previousSibling

          posted on 2009-10-28 13:52 becket_zheng 閱讀(163) 評論(0)  編輯  收藏 所屬分類: 網頁web前端技術
          主站蜘蛛池模板: 方正县| 张家港市| 宜宾市| 秭归县| 虹口区| 翁牛特旗| 红桥区| 府谷县| 嵊泗县| 安泽县| 荥阳市| 务川| 钟山县| 和顺县| 潍坊市| 横峰县| 荥阳市| 内乡县| 舞阳县| 古蔺县| 南宁市| 广昌县| 南京市| 崇礼县| 北宁市| 赤城县| 惠东县| 丹棱县| 杨浦区| 甘洛县| 炎陵县| 周宁县| 浮山县| 滨州市| 普兰店市| 通化市| 长丰县| 宜春市| 垫江县| 东乡| 镶黄旗|