2008-03-20から1日間の記事一覧
thisを意外と何の気なしにつかってるからいろいろ実験。 var hoge = "Global hoge"; function Hoge(){ this.hoge = "hoge"; } Hoge.prototype.func = function(){alert(this.hoge);}; var a = new Hoge(); a.func(); 実行結果は『hoge』とダイアログがでる。…
thisを意外と何の気なしにつかってるからいろいろ実験。 var hoge = "Global hoge"; function Hoge(){ this.hoge = "hoge"; } Hoge.prototype.func = function(){alert(this.hoge);}; var a = new Hoge(); a.func(); 実行結果は『hoge』とダイアログがでる。…