Feb 21, 2001 #1 tomy MIS Joined Dec 4, 2001 Messages 1 Location US in JavaScript How do i check during the Script if variable is already exists?
Feb 21, 2001 #2 AndrewGrabovsky Programmer Joined Feb 15, 2001 Messages 78 Location UA Hi tomy! Use this: alert(window.var_name); where var_name is your variable name. If it already exists, you'll get it's value. If not, you'll see "undefined" in opened message box. Andrew | starway@mail.com Upvote 0 Downvote
Hi tomy! Use this: alert(window.var_name); where var_name is your variable name. If it already exists, you'll get it's value. If not, you'll see "undefined" in opened message box. Andrew | starway@mail.com
Feb 21, 2001 #3 luciddream Programmer Joined Nov 8, 2000 Messages 712 Location US you can use this: if(varname) { //exists } or you can use: if(typeOf(varname) != "undefined" adam@aauser.com Upvote 0 Downvote
you can use this: if(varname) { //exists } or you can use: if(typeOf(varname) != "undefined" adam@aauser.com