为什么我收到 Uncaught SyntaxError: Unexpected token 。下面的代码有错误吗?控制台工作了,但我的 if 语句被破坏了。为什么?
var locations = $('myDiv');
console.log(locations.scrollTop(),locations.outerHeight())
if ( (locations.scrollTop()) => (locations.outerHeight()) ){ //error here
alert('end');
}
最佳答案
Greater than or equal operator是 >=
而不是 =>
。
关于javascript - jquery 中未捕获的语法错误 : Unexpected token .,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33146322/