Go Back   Ultimate Web Site Drop Down Menu Forum > Web Development > Javascript
Register FAQ Members List Calendar Today's Posts

Reply
Thread Tools Display Modes
Unread 09-01-2007, 08:22 PM
bcarl314 bcarl314 is offline
Senior Member
Join Date: Aug 2007
Posts: 141
  #1  
Default 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=='')
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 03:40 AM.


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