473,467 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

JSLint impled global

JSLint founds errors :
Error:
Implied global: findTextInTag 6, hash 3, keysAry 2

"findTextInTag" is an external function to the calling one

hash and keysAry are (supposed to be?) global variables defined like
that :

var keysAry = new Array();
keysAry = [ "name", "address", "tel", "email", "url", "im", "note" ];

var hash = new Array();
// "name", "address", "tel", "email", "url", "im",
"note"
hash[ "all" ] = [ true, true, true, true, true, true,
true ];
[...]
hash[ "note" ] = [ false, false, false, false, false, false,
true ];
the script is working however i wonder about those "errors", in other
word how to make the variables "hash" and "keysAry" explicitely globals
?

also, the function "findTextInTag" is called (always) from another one
"findTextInWhat", there are defined like that :

function findTextInWhat( person, txt, what ) {
// the content //
}
function findTextInTag( person, txt, tag ) {
// the content //
}

more precisely why this is an error calling "findTextInTag" from inside
"findTextInWhat" ?

what means "implied global" here ? I'd suppose implied is opposed to
explicit ?
--
Une Bévue
Mar 20 '08 #1
1 1605
Tom de Neef <td*****@qolor.nlwrote:
>
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.
OK, thanks a lot, in fact i didn't cut'n paste all of my code, that's
the reason way JSLint didn't see some variables as being explicitely
global...

I thought i had missunderstood something...
--
Une Bévue
Mar 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Douglas Crockford | last post by:
JSLINT now includes a list of member names in its report, along with the number of occurences of each member name. This is intended to make it easier to find misspellings. JSLINT takes a...
1
by: manos | last post by:
Hi all, I was wondering if anyone has managed to "validate" js file using jslint from the command line with an engine like rhino. Any suggestions/experiences really appreciated. Many thanks,...
1
by: Douglas Crockford | last post by:
JSLint is now available as a Konfabulator widget. Drop a .js file on it, and it will tell you about its coding weaknesses. JSLint is an essential tool for quality programming in JavaScript. You...
44
by: petermichaux | last post by:
Hi, I have been using the following line of code to create an object called "Serious" if it doesn't already exist. if (Serious == null) {var Serious = {};} This works in the scripts I use...
1
by: Jang | last post by:
In jslint's doc it says, "JSLint does not expect that a var will be defined in a block. This is because JavaScript blocks do not have block scope. This can have unexpected consequences. Define all...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.