Ultimate Web Site Drop Down Menu Forum

Ultimate Web Site Drop Down Menu Forum (http://www.udm4.com/forum/index.php)
-   Javascript (http://www.udm4.com/forum/forumdisplay.php?f=9)
-   -   assigning default values to undefined variables (http://www.udm4.com/forum/showthread.php?t=571)

bcarl314 09-01-2007 07:22 PM

assigning default values to undefined variables
 
I'm moving from php to JavaScript. What I want to do is assign a value to a variable only if the variable hasn't been assigned yet. In php it would be: if($variable=='') $variable='default value'; I thought the equivalent in javascript would be: if(variable=='')


All times are GMT. The time now is 12:38 PM.

Powered by vBulletin® Version 3.0.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.