true false 1 or 0

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
MartinSpeed
Advanced
Advanced
Posts: 18
Joined: Wed Mar 21, 2007 3:46 pm

true false 1 or 0

Post by MartinSpeed »

for the property values that can be set to true / false is it better to set them as

closeonclick=1;
closeonclick=true;
closeonclick='true';

Is there a difference? Is one particular way accepted by more browsers?

thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

If you set closeonclick= in the style area then you need to use "" around the true, if you set it in the item, do not use "", and as far as I know it doesn't matter whether it's true/false or 1/0, except that using numbers means no quotes in either place you use it.

Ruth
MartinSpeed
Advanced
Advanced
Posts: 18
Joined: Wed Mar 21, 2007 3:46 pm

Post by MartinSpeed »

Thanks for clearing that up.

Is their any particular reason why it is =true for the style area, and ='true' for the item area?

and does this format carry through for all variables which can be declared in the style and item areas?


Thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You have it backwards. In the style area anything that is more than just a numeral takes quotes, i.e. fontsize=14; fontsize="14px"; and in the aI string there are no quotes. So let's say in one item you want to have fontsize set to em or pts for whatever reason, it would be fontsize=1.5em;

As to why it's like that.... it has something to do with programming, strings and such, not something I really know about.

Ruth
Post Reply