javascript vs jQuery custom/Global Variables scope
<p>as my project gets a little over loaded with <code>javascript</code> &amp; <code>jQuery</code> scripts, 
i am having problems with my try on separating it all to sections, ...like  into <em>categories</em> or <em>stages</em> ...</p>

<p>so <strong>before</strong> these two calls,  which are 'current project' calls , </p>

 <pre class="lang-aspx prettyprint-override"><code>&lt;head&gt;
    //i am loading the jQuery &amp; jQuery-UI... and then :

    // right after jQuery comes my first section of project
    &lt;script type="text/javascript" src="jsV2\jQueryAjaxNoPostBack.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="jsV2\stage1.js" &gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
            // is valid in stage1.js , naturally...
            var jsTxtVal = document.getElementById("TBX_TableSelectorFirstStage");

            //and that won't work
            var jQueryTxtVal= $('#TBX_TableSelectorFirstStage').val();
    &lt;/script&gt;
&lt;/head&gt;
</code></pre>

<p>and in that separated file i try </p>

 <pre class="lang-jquery prettyprint-override"><code>//stage1.js

//---- before ready()-------
//won't work
var jQueryTxtVal= $('#TBX_TableSelectorFirstStage').val();

//works 
var jsTxtVal = document.getElementById("TBX_TableSelectorFirstStage");

$('document').ready(function () {


var TBX_TableSel = $('#TBX_TableSelectorFirstStage');
var jQueryTxtVal= $('#TBX_TableSelectorFirstStage').val();
var jsTxtVal = document.getElementById("TBX_TableSelectorFirstStage");

$('.someElement's Class).click(function () {

    // this will not work unless i will assign "jQueryTxtVal" right here .

    alert(jQueryTxtVal);


   //and... this will work no matter where the assignment took place .
   //either in main page (i call it "the globlas" of project)
   //or at the top of every "section" of project...

    alert(jsTxtVal );

   });
</code></pre>

<p>now if I would use  <em>plain</em>  <code>JavaScript</code> ,  I could even put a section of global variables, for all methods... almost anywhere , like within a <code>&lt;sctipt&gt;&lt;/srctipt&gt;</code> under jquery, in main page <code>.aspx</code></p>

<p>so I would like to know , <strong>how could i use "globals" in jQuery ?</strong> 
or it just the use case for that(?) .. I wouldn't think so...</p>

<p>...I also tried <code>defer="defer"</code> on <code>stage1.js</code> call , inside head- main page <code>.aspx</code>
nothing I try succeeds</p>
