On Jan 15, 2008 12:45 PM, ced <[EMAIL PROTECTED]> wrote:
> I don't quite see what you mean by dynmaic object. I wanted, with this
> construct, to avoid pulling the data out of the DOM piece I just
> included: As I know it before hand on the server. It 's like a data
> accessor on the html snippset.
I'm not really sure what you're trying to do here, but maybe you could
just set some variables and have your function return those instead of
redefining the function, such as:
var Data = {
id:null,
name:null,
get: function(){
return { id: this.id, name: this.name };
},
set: function( id, name ){
this.id = id;
this.name = name;
}
}
Then your Ajax responses would have some JavaScript like:
Data.set( 'my new ID', 'my new name' )
And your registerAlbum would be modified to be:
function registerAlbum(){
var albumData=Data.get();
albumColl.add(new Album(albumData));
}
Hope this makes sense. There are many different ways to accomplish
what you are trying to do, this is just one example.
-justin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---