Calling functions from previously-loaded JS file
<p>I'm using jQuery. I have a JS file (super.js) containing:</p>

<pre><code>$("#content").load("/profile");

function setHash(hash) {
   location.hash = "#/:-)/"+hash;
}
</code></pre>

<p>"/profile" loads another external JS file (profile.js) containing a call to setHash:</p>

<pre><code>setHash('blabber');
</code></pre>

<p>But it doesn't seem to work (setHash is undefined).</p>

<p>Edit: setHash is called from within a function in profile.js:</p>

<pre><code>function changePage(type) {
    setHash('bla/'+type);
}
</code></pre>

<p>How can I get "global" functions to work in JS files included in dynamically-loaded pages?</p>

<p>Thanks, Albert</p>
