[mochikit] can log but unable to return value from addCallback

2010-11-15 Thread hotani
I can log the value, but it returns as undefined. var getOffice = function(county_id) { var d = loadJSONDoc('/office_from_countytype/'+ county_id +'/'); var off_id; d.addCallback(function (result) { off_id=result[0].fields['office']; log('got office id: '+ off_id);

[mochikit] Re: can log but unable to return value from addCallback

2010-11-15 Thread hotani
// Fredrik Blomqvist On Nov 15, 7:04 pm, hotani hot...@gmail.com wrote: I can log the value, but it returns as undefined. var getOffice = function(county_id) {     var d = loadJSONDoc('/office_from_countytype/'+ county_id +'/');     var off_id;     d.addCallback(function (result

[mochikit] Re: createDom option example please

2007-06-15 Thread hotani
Ok. Like I say, this is not very clear to me right now, and I'm trying to create an option list for a drop-down. Let me put up my shot-in-the-dark example, then maybe someone can correct me: // add a single value/text option to drop-down: OPTION(null, {'value': '123', 'text': 'some text'});

[mochikit] Re: createDom option example please

2007-06-15 Thread hotani
Great, thanks Bob. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

[mochikit] Re: createDom option example please

2007-06-15 Thread hotani
And here is a real working example in all its glory: appendChildNodes($('id'), OPTION({'value':val}, txt)); where 'val' is an id from the database and 'txt' is its description. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[mochikit] Re: createDom option example please

2007-06-15 Thread hotani
Good to know, thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED]

[mochikit] really basic example?

2006-11-02 Thread hotani
Up until this morning, I thought I knew my way around JavaScript. Looking at the docs for MochiKit has proven otherwise. All I want is a basic example of a call to a json file, and output. The docs are shooting right over my head and I still don't get what deferred really means. There is a 450