I just tested my custom gallery script at JSLint.. and all errors where solved except for one.
The implied global error.. Is this really an error? Can I ignore it or should I work on it to solve this error..?
Thank you for your responses!
Error:
Implied global:
<bunch of vars and other stuff i dont know>
What does this mean? BTW I use JQuery Library.. maybe thats the problem^^..
if you use externally declared variables like in this case, put a 'global' statement at the top of your file, like this:
/*global $, document */
JSLint documentation says:
Undefined Variables and Functions
JavaScript's biggest problem is its dependence on global variables, particularly implied global variables. If a variable is not explicitly declared (usually with the var statement), then JavaScript assumes that the variable was global. This can mask misspelled names and other problems.
JSLint expects that all variables and functions are declared before they are used or invoked. This allows it to detect implied global variables. It is also good practice because it makes programs easier to read.
Care for that error. Nearly every coding convention wants you not to use implied globals.
Variables can be declared using the var
keyword.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With