0

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.

1 Answer 1

1

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.

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

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

Here's a good start on JSNI.

2
  • Thanks, I can't seem to find a Google tutorial on GWT JSNI calls, is there any tutorial you would recommend? Jul 11, 2012 at 19:50
  • 1
    first google result for JSNI: developers.google.com/web-toolkit/doc/latest/…. Note the blurb about 2.5 vs. 2.4, but it doesn't look like this doc has changed much. This is the only info that I've needed to implement similar interaction w/ 3rd-party javascript. But it can get complicated. Post new questions if you get stuck.
    – pb2q
    Jul 11, 2012 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.