2012-06-21 109 views

回答

6

因爲它是一個函數表達式(不是一個函數聲明),它應該有一個分號結束:

$.fn.hasScrollBar = function() { 
    "use strict"; 

    return this.get(0).scrollHeight > this.height(); 
}; //<-- Semi-colon here 

的JSLint抱怨的「意外的結束」,因爲它沒有想到會遇到結束其輸入在收盤價}字符。