Categories




PreviousNext
How to check a variable defined or not using javascript    
 Send mail Views:474
Belongs to : Javascript
Facebook Bookmarkbookmark this pageStumbleupon Bookmark 

We can check whether a variable is defined or not in a javascript program


for example take the below ex:

//This part of program is optional
var hi=1;
var page='http://hiox.org';


//This part of program we are going to check whether the variable is declared or not

try{
if(hi){//This line will be execute if variable "hi" defined previously
}
}
catch(err){// If the variable not defined the program will come to this part
var hi=10;
}



I feel its very useful.


funny pictures and videos
funny pictures and videos
online games
embed code


By - Vinoth, On - 2010-06-05
Send This
PreviousNext

User Comments


Add NEW Feedback:

Name :     Email :

Website Monitoring Web hosting by Hiox India Contact Us   Privacy Policy   Terms and Conditions