calling js file from aspx
<p>I have a aspx page and a js file, am accessing the js file for some functions, say for example I have some autocomplete boxes in my aspx page and for that am accessing the js file for every autocomplete box, and finally when I click the save button, the saveFunction in my js file should be fired, for this I just made my Save button as simple html button as</p>

<pre><code>&lt;button type="button" onclick="saveRecords()"&gt;Save&lt;/button&gt;
</code></pre>

<p>at the end of my aspx page am calling the js file as</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
     pageInit();                    
    });       
</code></pre>

<p></p>

<p>and in the pageInit of my js file I refer my saveRecords function as</p>

<pre><code>function pageInit() {    
saveRecords();
</code></pre>

<p>}</p>

<p>the problem here is whenever I run my application the saveRecords function is hitting first.....how can I avoid this, and call this function only when I hit Save button...can anyone help me here....</p>
