解决JSLint错误 [英] Solution for JSLint errors

查看:135
本文介绍了解决JSLint错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用JSLint了。我检查了我的代码,我收到了这个错误:

I have started using JSLint. I checked my code and I am getting this errors:


第92行问题7:将调用移动到包含该函数的parens中。$
})();

第92行问题7:包裹parens中的完整立即函数调用。

})();

Problem at line 92 character 7: Wrap the entire immediate function invocation in parens.
})();

如何解决这个错误?

推荐答案

我相信这意味着你应该在包装内移动调用parens的函数parens

I believe this means you should move the function calling parens inside the wrapping parens

(function() { /* code */ })() 

执行该功能的两个最后一个问题是问题所在。这就是jslint想要它的样子:

The two last parens that execute the function are the problem. This is how jslint wants it to look like:

(function() { /* code */ }()) 

这篇关于解决JSLint错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆