How to call js document.ready function in html?
<p>I am writing a webgame using jquery document.ready. When I call js function in html, it does not work:</p>

<p>js:</p>

<pre><code>$(document).ready(function(){
    function init(){blablabla...}
})
</code></pre>

<p>html:</p>

<pre><code>&lt;script src="function.js"&gt;&lt;/script&gt;
&lt;script&gt;
function bla(){
    if (blablabla)
        init();
}
&lt;/script&gt;
</code></pre>

<p>I learned html and js for only a few weeks. I have no idea why it does not work.</p>