fundamental javascript question -


i declared global:

var myclient; 

i have function:

//contact record object has tostring() prints name. function getclient() {    myclient = new object();    debug(input.contact); // prints    myclient.contact = input.contact;    debug(myclient.contact); // prints } 

i have function trying use same:

function dispatchclient() {     debug(myclient.contact); } 

and result see undefined. wrong here? (ignoring design aspect)

if wrong, how can pass state of global between functions? if not wrong, hmm, may need dig deeper!

dispatchclient being called before getclient gets called. @ point, myclient still undefined.


Comments