开发者

Is there a plugin to validate jQuery code?

开发者 https://www.devze.com 2022-12-29 06:05 出处:网络
Is there a jQuery plugin which can check our code before launch it ? Example: I write this : jQuery(\'.myclass\')css(\'color\',\'red\');

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 period

Or:

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

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

EDIT: or maybe it could be some Firefox plugin ?


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.


In addition to the above suggestions, you may also want to look at jQuery-lint - a script that checks your jQuery codes as they run and report incorrect or suboptimal usage usage of the jQuery API.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号