tags:

views:

29

answers:

2

I mean : is there a jQuery plugin which can check our code before launch it ?

Example:

I write this :

jQuery('.myclass')css('color','red');

The plugin will show me some message like 'parse error line ...' because I forgot a dot

Or :

function test() {
    alert('test');
...
tet();

Message: The tet() function doesn't exist.

So...

What you do think ?

EDIT: or maybe it could be some Firefox plugin ?

+6  A: 

This can't be a plugin because if you have syntax errors in your code, the browser will stop execution and show an error. JSLint is an online service you could use to validate your javascript.

Darin Dimitrov
And if we wrap our code in a validation function ?And if the code is valid: document.write(our code)else alert('some errors ...');What do you think ?BTW : I already know JSLint but it's not efficient when you are coding... But useful when you have finished coding...
aurelien
+3  A: 

As 'Darin Dimitrov' said jQuery is not a language to have some special syntax but it is a javascript library so the syntax validation should be done against javascript

If you are using a IDE like Eclipse there are javascript plugins like spket, aptana which will help you to find out some syntax errors

Arun P Johny