2011-04-17 構造体を利用したオブジェクト指向? raisana Follow 2011-04-28 01:19:40 License: MIT License Fork0 Fav0 View1528 Play Stop Reload Fullscreen Smart Phone Readme JavaScript 34 lines HTML 4 lines CSS 0 lines 適当に書いています. 2011-04-17 構造体を利用したオブジェクト指向? /************************************************ /* testクラス ************************************************/ var CTest = { //=============================================== // デバッグ出力 //=============================================== func1 : function(){ document.getElementById('debug1').innerText = "DEBUG"; }, //=============================================== // デバッグ出力 & CTest.strに文字列の代入 //=============================================== func2 : function(){ this.str = "構造体を利用したオブジェクト指向?"; } }; //=============================================== // main //=============================================== window.onload = function(){ CTest.func1(); CTest.func2(); document.getElementById('debug2').innerText = CTest.str; }; <body> <div id="debug1">デバッグ1</div> <div id="debug2">デバッグ2</div> </body> 2011-04-17 構造体を利用したオブジェクト指向? 適当に書いています. /************************************************ /* testクラス ************************************************/ var CTest = { //=============================================== // デバッグ出力 //=============================================== func1 : function(){ document.getElementById('debug1').innerText = "DEBUG"; }, //=============================================== // デバッグ出力 & CTest.strに文字列の代入 //=============================================== func2 : function(){ this.str = "構造体を利用したオブジェクト指向?"; } }; //=============================================== // main //=============================================== window.onload = function(){ CTest.func1(); CTest.func2(); document.getElementById('debug2').innerText = CTest.str; }; <body> <div id="debug1">デバッグ1</div> <div id="debug2">デバッグ2</div> </body> use an iframe compat browser, deer Play on jsdo.it games Author Share ブログに埋め込む QR Tag Download Complete! Description What kind of game? 適当に書いています. Control Device Smartphone Controllerjsdo.it WebSocket Controller» Mouse Keyboard Touch Device Fullscreen Activated Inactivated jsdo.it games から削除する Submit Author raisana URLhttp://www21.atpages.jp/lyrycal/ JQueryは使用しません. prototypeもあまり利用しません. twitter : http://twitter.com/#!/raisana1008153 Tweet Default Panel Auto play Screenshot Readme JavaScript HTML CSS Size Width: px Height: px code <script type="text/javascript" src="http://jsdo.it/blogparts/uH1p/js"></script> JavaScript, Object オブジェクト指向, Discussion Questions on this code? Tags JavaScript, Object オブジェクト指向,