jQuery and JSLint

jQuery and JSLint

Many days ago I used to write subroutines in assembly language for the Commodore Computer. You could call these subs much the same as a function in JavaScript. I had a very large library of these subs but I did not enter the whole library. With only 64k of memory, it was not possible!

  Today memory is not a big concern. As a webmaster, memory now means download speed. Again the size of a file becomes important. While learning JavaScript I became aware of jQuery and I remembered the “good old days”.  I now have an animation that uses jQuery on my web site. The JS code was downloaded from the web somewhere and the browser reported an error on the page. The error was reported to come from the animation code.

  I put the code in JSLint and fixed the two errors it found (!= instead of !==). Still the browser reports errors on the page and again from the same code. As jQuery is called into the code, I put jQuery as downloaded into JSLint. I was very surprised! I had 50 errors with less than 1% scanned.

  jQuery works very well, but I dislike errors and large files. I will run it as is until I have time to fix the errors. I am learning C+ at this time to fix the errors in that code. This leaves me with two questions about jQuery.
  First, what can you tell me about running jQuery in JSLint? Is there a reason for the large error report?

Second, Can jQuery be broken down into smaller scripts allowing only those needed to be included?

I think with time it could be done. Documentation would need to be written to give each scripts use. jQuery is a large file and is documented very well as downloaded, but many functions call other parts of jQuery. Those parts would need to be duplicated to form complete “subroutines”. Has this been done already?

 

Thanks and I believe that as I learn, I will become a fan of jQuery!