slipperyfish Posted March 30, 2006 Share Posted March 30, 2006 how do you check if a variable exsists in javascript?i no in PHP you can use:[code]isset($var)[/code]is there something similar in javascript? Quote Link to comment https://forums.phpfreaks.com/topic/6166-checking-if-var-exsists/ Share on other sites More sharing options...
wildteen88 Posted March 31, 2006 Share Posted March 31, 2006 Javascript doesnt have a pre built in function like isset. If want to check variable you'll have to do it like this:[code]if(varName != ""){ //then do something here}else{ //do something else here}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/6166-checking-if-var-exsists/#findComment-22588 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.