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
As poi said, kbinput is undefined because you never defined it. The reason you received the error rather than seeing "NO KBINPUT", however, is because you can't check for undefined global variables using the == operator unless you check them in terms of the window object. E.x. [b]kbinput==undefined[/b] throws an error, but [b]window.kbinput==undefined[/b] would show your error message. Object properties need not be prepended with "window.", however -- [b]globvar.kbinput==undefined[/b] would work just fine. ---------------------- [url=http://www.ozoneasylum.com/30926][img]http://img19.imageshack.us/img19/268/cellu.gif[/img][/url][url=http://davidjcobb.deviantart.com/][img]http://img262.imageshack.us/img262/428/24464470.gif[/img][/url][url=http://getfirefox.com/][img]http://img515.imageshack.us/img515/6336/25338231.gif[/img][/url][img]http://img4.imageshack.us/img4/2163/end.gif[/img]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »