title: Global variable in JQuery is not updating it's value form inside the click function
body: <p>I have a Jquery problem. My global variable <code>xyz</code> is not updating it's value.
  Here I like to change the value of my <code>xyz</code> variable.</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
      .............................
      .............................
      var xyz="testing";
                              function getTest(code) {
                                  if(code == 0){
                                      xyz = "I am testing 0";                                     
                                  } else if(code == 1){
                                      xyz = "I am testing 1";     
                                  }
                              }
  </code></pre>
  
  <p>Now I am calling my <code>xyz</code> inside the datatables but it is always printing the global value. i.e. <code>testing</code></p>
  
  <pre><code>dt = $('#someTable').dataTable(
                                  {
  ...............
  "sTitle" : xyz,
  
  ...............
  &lt;end of data table function&gt;
  </code></pre>
  
  <p>I am trying to call the function here to update value of my <code>xyz</code> variable. Here I am invoking <code>getTest()</code>.    </p>
  
  <pre><code>$("#div").click(function(event) {
  ........................
  ...........................
  if(code==0){
  getTest(code);
  } else if (code==1){
  getTest(code);
  }
  
  &lt;end of all the function&gt;
  </code></pre>
  
  <p>EVERY THING IS INSIDE THE DOCUMENT.READY FUNCTION</p>