title: Global variable in Javascript Namespace
body: <p>I m new with Javascript Namespace, I have 2 buttons <code>Add</code> &amp; <code>Remove</code>, I have the following script below.</p>
  
  <pre><code>&lt;script&gt;
      var nRow=1;
      function Add() {
          nRow++;
          alert(nRow);
      }
      function Remove() {
          nRow--;
          alert(nRow);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>What I'm trying to do to put this script in a namespace and call the functions <code>onClick</code> of the buttons. Please tell me how to put it in namespace and call the functions.</p>