alanwilliamson
10 Aug 2007, 3:04 AM
Okay, i am sure i am missing something really dumb here.
The whole remote JSON procedure i am very comfortable with. You effectively have a colleciton of data that is represented as a single toplevel object.
So my question is this.
Assume I have an object like this, with various prototyped methods that act upon it. Now also assume there is lots of fields/methods here. I have reduced it for the sake of illustration.
function myObj(){
this.title = "";
}
myObject.prototype = {
init : function(){
},
getTitle : function(){
return this.title;
}
}
When I load the data from a server side script that returns back a JSON object { title: "xyz" } then do i apply it to my client side object. How do i create instances of myObj with the data from the remote side.
thanks
The whole remote JSON procedure i am very comfortable with. You effectively have a colleciton of data that is represented as a single toplevel object.
So my question is this.
Assume I have an object like this, with various prototyped methods that act upon it. Now also assume there is lots of fields/methods here. I have reduced it for the sake of illustration.
function myObj(){
this.title = "";
}
myObject.prototype = {
init : function(){
},
getTitle : function(){
return this.title;
}
}
When I load the data from a server side script that returns back a JSON object { title: "xyz" } then do i apply it to my client side object. How do i create instances of myObj with the data from the remote side.
thanks