ISBN(1590595335)

ISBN(8960770035,N)

http://domscripting.com

[DOM] Scripting. JeremyKeith 저서, 부제 WebDesign with JavaScript and the [DOM], 번역판 제목 DOM 스크립트

관련포스트

주요내용

Node (nodeType)

  1. element (1)
  2. attribute (2)
  3. text (3)

꼭 알아야할 핵심 기본기

  1. 단계적 기능 축소 (Graceful degration) : 스크립트를 사용하지 않더라도 동작 가능한 웹문서 만들기
  2. 스크립트 분리 (Unobtrusive JavaScript) : 웹 문서 구조에서 동작 분리하기

  3. 하위 호환성 (Backwards compatibility) : 구 웹 브라우저에서도 동작 가능하도록 확인하기

위 내용을 준수한 팝업 윈도우 스크립트 (a tag에 class="popup"을 적은 후)

   1 function popUp(winURL) {
   2     window.open(winURL, 'Pop-up window', 'width=320, height=480');
   3     return false;
   4 } 
   5 
   6 window.onload = function() {
   7     if (!document.getElementsByTagName) return false;
   8     var links = document.getElementsByTagName('a');
   9     for (var i=0; i<links.length; i++) {
  10         if (links[i].className == "popup") {
  11             links[i].onclick = function() {
  12                 return popUp(this.getAttribute('href'));
  13             }
  14         }    
  15     }

[DOM] core and HTML-DOM

document.getElementsByTagName("form")
document.forms

element.getAttribute("src")
element.src

element.setAttribute("src", a)
element.src = a


CategoryBookComputer

web biohackers.net