在Java / GWT中使用JSLint [英] Using JSLint in Java/GWT

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

问题描述

我正在Java中开发一个项目,这将允许用户将Javascript代码输入到GWT Widget中。如何导入/使用JSLint来检查错误?我环顾四周,发现LSLint4Java,但是找不到导入到eclipse的方式。我只需要一个简单的JS错误检查器,将检查一个字符串是否有错误。

I'm currently working on a project in Java, that will allow users to type Javascript code into a GWT Widget. How would I go about importing/using JSLint to check for errors? I looked around and found LSLint4Java, but I couldn't find the way to import it into eclipse. I just need a simple JS error checker that will check a string for errors.

如果有任何其他建议进行错误检查,请分享!
谢谢。

If anyone has any other suggestions for error checking, please share them! Thanks.

推荐答案

可以找到JSlint javascript源代码这里。您可以在您的WAR中包含JavaScript,并在您的页面中引用脚本链接,并从您的GWT代码进行JSNI调用。

The JSlint javascript source can be found here. You could include the javascript in your WAR, reference it with a script link in your page(s), and make JSNI calls from/to your GWT code.

请注意JSLint在其许可证中有一个 No Evil 子句:

Note that JSLint has a No Evil clause in it's license:


//本软件应用于好

// The Software shall be used for Good, not Evil.

这里是JSNI的一个很好的开始。

Here's a good start on JSNI.

这篇关于在Java / GWT中使用JSLint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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