'prototype 를 이용한 DOM 핸들링'에 해당되는 글 1건

  1. 2009.12.02 prototype 를 이용한 DOM 핸들링
반응형




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="utf-8">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>javascript :prototype 사용 변수 선언 </title>
  <script type="text/javascript" src="prototype.js"></script>
 
  <SCRIPT LANGUAGE="JavaScript">
   
  <!--

   function addLoadEvent(func) {
     var oldonload = window.onload;
     if (typeof window.onload != 'function') {
    window.onload = func;
     } else {
    window.onload = function() {
      oldonload();
      func();
    }
     }
   }


   var Subject = Class.create();

   Subject.prototype ={
    initialize:function(){
     var subjectList = new Array("java","jsp","ajax");
     var console = document.getElementById("area");
     if(console != null){
      console.innerHTML += "<b>수강과목</b><br/>"+subjectList+"";
     }
    }
   
   }
   function objectCreate(){
    var subject = new Subject();
   }
   addLoadEvent(objectCreate);

   

  //-->
  </SCRIPT>
 </head>
 <body>
  <div id="area"></div>
 </body>
</html>

Posted by 1010