Is it possible to validate my jQuery JavaScript with JSLint? Is it possible to validate my jQuery JavaScript with JSLint? jquery jquery

Is it possible to validate my jQuery JavaScript with JSLint?


That's not valid JavaScript, it should be:

$(document).ready(function() {

So JSLint will (appropriately) complain about your syntax.

If you want to get rid of the Implied global: $, document message, go to the bottom where it has Predefined (, separated), and put jQuery, $ in that textbox then run again. For the document piece, check Assume a browser in the first column.

All JSLint settings will stick, so you don't have to do this each time you go back.


Add this at the top of your document to get it to validate:

/*jslint browser: true*/ /*global  $*/


Nick is correct about your syntax. The latest release of jQuery (1.4.3) passes JSLint tests. See this blog post: http://blog.jquery.com/2010/10/16/jQuery-143-released/