title: update global variable from a function in the javascript
body: <p>Here is the situation:</p>
  
  <p>I have one function which has local variable. 
  I would like to assign that value to global variable and us it's value in another function.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>global_var = "abc";
  
  function loadpages()
  {
      local_var = "xyz";
      global_var= local_var;
  }
  
  function show_global_var_value()
  {
      alert(global_var);
  }
  </code></pre>
  
  <p>I'm calling show_global_var_value() function in the HTML page but it shows the value = "xyz" not "abc"</p>
  
  <p>What am I doing wrong?</p>