タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

debugとjqueryに関するnilabのブックマーク (1)

  • 8行でjQueryのデバッグが楽になるjQuery.pの紹介 - KAYAC Engineers' Blog

    週末はオレ標準JavaScript勉強会のUstreamを眺めてました。ago(@kyo_ago)です。 以前jQuery使いが陥りやすい罠の中で「4 何でも一行で書こうとする」という点を上げたのですが、以下のようなmethodを定義することでmethod chainのデバッグが楽になるので紹介したいと思います。 $.fn.p = function (id) { var arg = [this]; if (id) arg.unshift(id); if (!window.console) return this; var c = window.console || { 'log' : function () {} }; (c.debug || c.log).apply(c, arg); return this; }; 具体的な使い方ですが、以下のように確認したいmethodの後に.p()を

    8行でjQueryのデバッグが楽になるjQuery.pの紹介 - KAYAC Engineers' Blog
    nilab
    nilab 2010/08/03
    8行でjQueryのデバッグが楽になるjQuery.pの紹介 | tech.kayac.com - KAYAC engineers' blog
  • 1