小编Ste*_*ung的帖子

关闭编译器警告`危险使用全局此对象`?

亲爱的朋友们,Closure Compiler在高级模式下给出了这个警告,下划线 {this.

JSC_USED_GLOBAL_THIS:在第200行字符33处危险使用全局此对象 hovers[i4].onfocus = function() {this.className += "Hovered";}

JSC_USED_GLOBAL_THIS:在201行第32行危险地使用全局此对象 hovers[i4].onblur = function() {this.className = this.className.replace(/Hove...

JSC_USED_GLOBAL_THIS:在201行第49行危险使用全局此对象 hovers[i4].onblur = function() {this.className = this.className.replace(/Hove...

JSC_USED_GLOBAL_THIS:在第218行字符38处危险使用全局此对象 buttons[i5].onmouseover = function() {this.className += "Hovered";}

Q1.这有什么危险吗?
Q2.我应该改变吗?
Q3.如何改进/解决此代码?

MERCI!

javascript debugging jquery google-closure-compiler

16
推荐指数
3
解决办法
8307
查看次数