![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
JSLint founds errors : Error: Implied global: findTextInTag 6, hash 3, keysAry 2 snip the script is working however i wonder about those "errors", in other word how to make the variables "hash" and "keysAry" explicitely globals ? snip what means "implied global" here ? I'd suppose implied is opposed to explicit ? -- |
#3
| |||
| |||
|
|
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. |
#4
| ||||
| ||||
|
|
""Une Bév" wrote: JSLint founds errors : Error: Implied global: findTextInTag 6, hash 3, keysAry 2 snip the script is working however i wonder about those "errors", in other word how to make the variables "hash" and "keysAry" explicitely globals ? snip what means "implied global" here ? I'd suppose implied is opposed to explicit ? |
|
-- There is some documentation with JSlint at http://www.jslint.com/lint.html It states: 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |