Feb 21, 2001 #1 tomy MIS Dec 4, 2001 1 US in JavaScript How do i check during the Script if variable is already exists?
Feb 21, 2001 #2 AndrewGrabovsky Programmer Feb 15, 2001 78 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 Nov 8, 2000 712 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