2012-06-21 106 views

回答

6

因为它是一个函数表达式(不是一个函数声明),它应该有一个分号结束:

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

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

的JSLint抱怨的“意外的结束”,因为它没有想到会遇到结束其输入在收盘价}字符。