Хелов...помогите розобратса ....
| Код | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript"> function tab(tab_head, tab_body){ this.tab_head =tab_head; this.tab_body =tab_body; this.defconstr =defconstr; this.howMany = howMany; this.bodyConstruct =bodyConstruct; //this.root = root; root = document.getElementById('main');//root has no properties...... можна так? :crazy head_tab = document.createElement("div"); root.appendChild(head_tab); head_tab.className="tabHeader"; newtext = document.createTextNode(tab_body); function defconstr() { //root = document.getElementById('main'); ////////////////////// one_head = document.createElement("div"); head_tab.appendChild( one_head ); one_head.setAttribute("style","float:left"); onehead_text = document.createTextNode(tab_head); one_head.appendChild(onehead_text); one_head.className = "tabPage" /////////////////////////////////////// /*two_head = document.createElement("div"); head_tab.appendChild(two_head ); two_head.setAttribute("style","float:left"); twohead_text = document.createTextNode(tab_head); two_head.appendChild(twohead_text); two_head.className = "tabPage" ///////////////////////////////////////*/ } function bodyConstruct(){ } function howMany(how){ for (var i=0; i<how; i++) defconstr(); bodyConstruct(); }
//window.addEventListener?window.addEventListener("load", howMany(4), false): window.attachEvent("onload", le.howMany(4));
} </script> <link rel="stylesheet" type"style/css" href="aa.css" /> </head> <body onload ="le.howMany(4)"> <script type="text/javascript"> var le = new tab("firstTab","Nadia"); </script>
<div id ='main' class="tabControl"> </div> </body> </html>
|
или ето проблема ориентно-прототипности.... |