Including a Function on body onload isn't working
<p>I have a JavaScript function as shown </p>

<pre><code>Event.observe(document, 'dom:loaded', function() {

    prettyPrint();

    HumbleFinance.trackFormatter = function (obj) {

        var x = Math.floor(obj.x);
        var data = jsonData[x];
        var text = data.date + " Price: " + data.close + " Vol: " + data.volume;

        return text;
    };


    HumbleFinance.init('finance', priceData, volumeData, summaryData);
    HumbleFinance.setFlags(flagData); 

});
</code></pre>

<p>I want to call this function on body onload of the HTML Page , but when i used body onload , it isn't working .
But when i include the function manually as script src="demo.js" its working fine (Where this whole function is kept as a seperate js file)  </p>

<p>Please tell me as how to resolve this ??</p>
