[thelist] javascript detecting if function/var is already defined

jsWalter jsWalter at torres.ws
Thu Nov 27 11:53:30 CST 2003


> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of
> christof.hoeke at e-7.com
> Sent: Thursday, November 27, 2003 8:01 AM
> To: thelist at lists.evolt.org
> Subject: [thelist] javascript detecting if function/var is already
> defined
> 
> 
> hi,
> i have a problem with a script which depends on a function x() 
> which may be defined or not, depending on the page.
> normally i (at least i think it worked) tried to find out if x is 
> available by checking
> 
> 	if (x == "undefined") 

Try this

 	if (typeof x == "undefined") 

Walter




More information about the thelist mailing list