隨手筆記

隨手寫下個人筆記

2012年10月18日 星期四

JSLint error: “Move the invocation into the parens that contain the function”

現在大家很流行將 function 包裝成匿名 function,一方面可以避免太多全域變數,另外一方面可以封裝 function 以避免 function 被後來的 JavaScript 蓋台。底下是常用的匿名 function 建構方式:
var myObj = (function () {
    // 做你想做的事
})();
閱讀更多 »
沒有留言:
標籤: JavaScript, JSLint
較新的文章 較舊的文章 首頁
訂閱: 文章 (Atom)

網誌存檔

  • ►  2014 (1)
    • ►  3月 (1)
  • ▼  2012 (2)
    • ▼  10月 (1)
      • JSLint error: “Move the invocation into the parens...
    • ►  7月 (1)
  • ►  2010 (8)
    • ►  4月 (2)
    • ►  3月 (6)
  • ►  2008 (7)
    • ►  12月 (1)
    • ►  9月 (1)
    • ►  8月 (2)
    • ►  7月 (1)
    • ►  6月 (1)
    • ►  3月 (1)
  • ►  2007 (1)
    • ►  11月 (1)
  • ►  2006 (15)
    • ►  8月 (1)
    • ►  5月 (5)
    • ►  4月 (3)
    • ►  3月 (2)
    • ►  2月 (2)
    • ►  1月 (2)
  • ►  2005 (44)
    • ►  12月 (1)
    • ►  11月 (8)
    • ►  10月 (4)
    • ►  8月 (2)
    • ►  7月 (4)
    • ►  6月 (3)
    • ►  5月 (12)
    • ►  4月 (10)

標籤

  • 軟體 (3)
  • Beyond Compare 3 (1)
  • CSS (2)
  • Firefox (3)
  • Google Chrome (1)
  • JavaScript (1)
  • JSLint (1)
  • Linux (2)
  • openSUSE (7)
  • PHP (1)
  • shell (1)

Plurk

Plurk.com

Links

  • Google News
頂尖企業主題. 技術提供:Blogger.