2009-11-21から1日間の記事一覧

javascriptで関数をおさらい

javascriptの関数。 function testFunc() { alert(1); }これと var testFunc = function() { alert(2); }これはほぼ同義。 上のほうがよく見る。 呼び出し方 呼び出し方も何通りかある。 testFunc();(testFunc)();すぐに実行するなら、こういうのもあり (fun…

GreaseMonkey作成時のデバッグ

autopagerize を勉強で読んでたら使っていて便利そうだったので。 //初期設定 var DEBUG = true; function debug() { if ( typeof DEBUG != 'undefined' && DEBUG ) { console.log.apply(this, arguments) } }そして、 var testText = "this is test text"; …