>Hey all, 
>
>I've got two javascript functions in a .js template.
>
>If I set a var in the first function, can I use it in the second function?

It depends on whether or not you scope it locally.

The "var" keyword tells a variable "you're only available in the current or 
child scopes".  Without the key word the variable will be global and available 
to anything.

For example:

function MyFunc1() {
   var foo = 1;  // I'm a local var!
   faa = 1; // I'm a global var!
};

Jim Davis


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:233134
Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5

Reply via email to