JQuery Lint Errors

I found out about jQuery Lint in the Firebug plugin. However, its results are confusing and very difficult to try and satisfy. I get hundreds of errors saying jQuery (...) called incorrectly .

For example, this line contains a warning. What am I doing wrong here?

 $('#myTextBox').val(someValue); 

And when I try to remove all lines from tbody that have no lines, it throws an error that stops all javascript on the page. He says that no elements were found with this selector, and then deleting is not a function.

 $('#myTbody > tr').remove(); 

Do I really need to add extra code to get around this? How should jQuery Lint be useful?

+4
source share
1 answer

Here I made a simple example: jsfiddle.net/DJzFe/

There you will see that your 2 lines of code do not warn you about jQuery Lint if you are using jQuery 1.4.4, but I suspect you are using jQuery 1.5.1, which hasn’t been tested by jQuery Lint yet ( it has only been tested c 1.3.2 and 1.4.4 ). And in 1.5.1, these instructions will warn as you described: jQuery(...) called incorrectly

+2
source

Source: https://habr.com/ru/post/1343110/


All Articles