<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<script type="text/javascript" src="lb-core.js"></script>
<script type="application/javascript">
var lbp = {
defaults: {
color: "blue"
},
init: function(config) {
if(config) {
for(prop in config){
setBgcolor.defaults[prop] = config[prop];
}
}
var bod = document.body;
bod.style.backgroundColor = setBgcolor.defaults.color;
}
}
window.onload = lbp.init();
</script>
</HEAD>
<body>
<div id="container">test</div>
</body>
</HTML>
Why does bod come back as undefined when the above is called at window.onload?