V
vunet
I used to have an object written in this format:
var obj = new Object();
obj.prop = "blah";
obj.myFunction = function(){
//something here
}
obj.myFunction.prototype = {
id1:'',
id2:function{
}
//etc
}
Now I try to place obj into another object but I have "missing : after
property id" error in prototype line. Could someone correct? I am not
much used to this format so I am getting confused.
var superParentObj = {
parentObj : {
prop = "blah";
myFunction : function(){
//something here
},
myFunction.prototype = { //<===== missing : after property
id
id1:'',
id2:function{
//...
}
//etc
}
}
}
var obj = new Object();
obj.prop = "blah";
obj.myFunction = function(){
//something here
}
obj.myFunction.prototype = {
id1:'',
id2:function{
}
//etc
}
Now I try to place obj into another object but I have "missing : after
property id" error in prototype line. Could someone correct? I am not
much used to this format so I am getting confused.
var superParentObj = {
parentObj : {
prop = "blah";
myFunction : function(){
//something here
},
myFunction.prototype = { //<===== missing : after property
id
id1:'',
id2:function{
//...
}
//etc
}
}
}