Prototypesallowed only after the initialization of the object, so change the code to the following:
It seems that after some research I was mistaken, the problem is that when used document.*before loading the window document.*is only available after it has <body>been loaded into the DOM.
therefore, it GetElementById()will only work after the actual item you are trying to select is inside the dom
var ById = function(i){return document.getElementById(i);}
var balloon = function(){}
window.onload = function(){
var oBalloon = new balloon();
balloon.prototype.iHeight = ById("wrapper").clientHeight;
}
, ,