Changeset 1665
- Timestamp:
- 11/16/07 19:03:18 (6 years ago)
- Location:
- lang/javascript/naoscheme
- Files:
-
- 2 modified
-
index.html (modified) (1 diff)
-
naoscheme.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/naoscheme/index.html
r1663 r1665 16 16 (alert e) 17 17 (call document.body "appendChild" (call document "createTextNode" "こんにちは!")) 18 (add-event-listener (call document "getElementById" "top") 19 "click" 20 (lambda (e) 21 (alert (list (prop e "clientX") (prop e "clientY"))))) 18 22 ) false) 23 19 24 </script> 20 25 <script src="naoscheme.js" type="text/javascript"></script> 21 26 </head> 22 27 <body> 23 >_< 28 <h1 id="top">>_<</h1> 29 <table> 30 <thead> 31 <th>Log</th> 32 </thead> 33 <tbody> 34 </tbody> 35 </table> 24 36 </body> 25 37 </html> -
lang/javascript/naoscheme/naoscheme.js
r1653 r1665 1 1 2 function log (s) { 2 function log (s) { try { 3 3 if (window.console) 4 4 console.log(s); 5 } 5 var tb = document.getElementsByTagName("tbody")[0]; 6 if (tb) { 7 var tr = document.createElement("tr"); 8 var td = document.createElement("td"); 9 td.appendChild(document.createTextNode(String(s))); 10 tb.appendChild(td); 11 } 12 } catch (e) {}} 6 13 7 14 function NaoScheme () { … … 103 110 }, 104 111 112 prop : function (obj, key) { 113 return obj[key]; 114 }, 115 105 116 car : function (list) { 106 117 return list[0]; … … 117 128 split : function (sep, list) { 118 129 return list.split(sep); 130 }, 131 132 list : function (list) { 133 return Array.prototype.slice.call(arguments, 0); 119 134 }, 120 135
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)