javascript object always null -
here code:
myext = {}; myext.panel = function (config){ var d = document.createelement("div"); /*do (a lot) config , d here // lot of code here */ return { div:d, events:e, customattribs:ca }; }
here caller:
var p = new myext.panel({ id:'parent', events:{ onload:function(){ alert("onload"); } }, //more configs });
if do
console.log(p)
i null. please me debug problem.
automatic semicolon insertion has turned return value of function from:
return { div: d, events: 3, customattribs:ca };
into:
return;
it better if stored value want return in variable, , return object:
var ret; ret = { div: d, events: e, customattribs: ca }; return ret;
Comments
Post a Comment