OZONE Asylum
Forums
DHTML/Javascript
My global variable - why is it undefined?
This page's ID:
31277
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I code my global variables first, then my window.onload function, like this: [code]var globvar = { oneTimeSwitch: "0", kbinput: document.createElement("INPUT"), kbdivision: document.createElement("DIV"), etc. } window.onload = function() { if (kbinput==undefined) alert("NO KBINPUT"); setTriggers(); }[/code] Why do I get the error: "KBINPUT IS NOT DEFINED"? and Why doesn't the IF statement for UNDEFINED element catch the problem?
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »