Monday, February 07, 2011

JSLint

Lint is a tool which finds common errors in Java code. It's very handy and is usually able to find *something* you ought to fix. Well, there's a JSLint for Javascript too!
Note, it will complain about globals (like alert). You can, at the top of your javascript, put a comment and define a comma delimited list of globals to ignore:
/*global alert, console, $, $$ */

1 comment:

Anonymous said...

Hej hopp i Malmö! Jättetack för
/*global alert: true, window: true, $: true */

Äntligen klarar mitt lilla script JSlint! :)

Kort fråga: Om man använder php i scriptet, vad händer då med Jquery's $ ?

Sara at comhem dot se

Labels

Blog Archive

Contributors