Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

testing if a variable is defined

Status
Not open for further replies.

cannonball

Technical User
Mar 15, 2002
1
US
Is there a command i can use when testing javascript test whether a variable is defined?
 
try inserting an alert()statement in your code with the variable name in the paren's When the code executes it will pop a window with the value of the variable in it. If it says "undefined" then the variable is undefined.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top