1
在jQuery plugin boilerplate有一些很棒的jQuery插件開發的啓動代碼,但是將代碼複製並粘貼到打印機中並編譯會導致編譯失敗。需要對jQuery插件樣板文件進行哪些修改才能在打字稿中編譯?
錯誤來自undefined
參數,它沒有被調用(故意使用),所以問題是需要進行哪些修改才能編譯它。它可以被刪除嗎?
在jQuery plugin boilerplate有一些很棒的jQuery插件開發的啓動代碼,但是將代碼複製並粘貼到打印機中並編譯會導致編譯失敗。需要對jQuery插件樣板文件進行哪些修改才能在打字稿中編譯?
錯誤來自undefined
參數,它沒有被調用(故意使用),所以問題是需要進行哪些修改才能編譯它。它可以被刪除嗎?
製作undefined
可選:
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
; (function ($ : any, window, document, undefined?) {
// undefined is used here as the undefined global variable in ECMAScript 3 is
// mutable (ie. it can be changed by someone else). undefined isn't really being
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined
// can no longer be modified.
這將使該模板編制,因爲不確定是不是傳遞給函數。
完美!謝謝! – djbyter 2013-04-11 14:26:04