I would put your next function inside the Ajax.Request, as a
callback. Then you are sure to have the value.
getRecordCount: function() {
var myAjax = new Ajax.Request(
'getObjects.aspx',
{
method: 'get',
parameters: '',
onSuccess: function(response) {
myObject.recordCount = eval('(' +
response.responseText + ')');
},
onComplete: function(){
//do something with recordCount here
//it's guaranteed to be here at that
point
}
});
}
Walter
On Feb 6, 2008, at 2:19 PM, mng0 wrote:
> getRecordCount: function() {
>
> var myAjax = new Ajax.Request(
> 'getObjects.aspx',
> {
> method: 'get',
> parameters: '',
> onSuccess: function(response) {
> myObject.recordCount = eval('(' +
> response.responseText + ')');
> }
> });
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---