We can do it with following code,
if (variablename == undefined){
variablename = 'XYZ';
}
But for some reason, firefox will throws error with above code. So the solution to that problem is,
if(window.variablename == undefined){
window.variablename = 'XYZ';
}
No comments:
Post a Comment