Remove javascript file from document when cetain event occurs
<p>I have these three script files </p>

<pre><code>&lt;script type="text/javascript" src="script/inbox.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="script/news.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="script/friend.js"&gt;&lt;/script&gt;
</code></pre>

<p>I am loading these files dynamically when user clicks certain links.</p>

<p>for example 
when user clicks inbox inbox.js is loaded and in similar manner.</p>

<p>All these files inbox.js,news.js,friend.js all have code that handles scroll event.
Now even when user has switched to news from inbox still the handler for scroll in news is also getting called. I need to ensure that the handler for only that tab is callled when user is at particular tab.</p>

<p>Some directions that can be proceeded in to solve the problem is -</p>

<ol>
<li>Dynamically unload the other script file from the document.</li>
<li>Unbind the scroll handler for the other tabs.</li>
<li>Some how I can assign ID or class to these script file and unload them.</li>
</ol>

<p>Please help me, which of these would be better way.</p>
