title: Call a function defined in one JSP file in another JSP file
body: <p>I have two jsp files.
  In one of them i have a function which has a variable, say x, that I need to use in another jsp file. So I made a variable , say y, outside the function and in that function, I called a serVar() function which sets y to x. Something like ...</p>
  
  <pre><code>&lt;script&gt;
  .
  .
  .
  var y;
  function someFunction()
  {
  var x;
  .
  .
  setVar(x);
  }
  
  function setVar(x)
  {
  y=x;
  }
  
  function getVar()
  {
  return y;
  }
  .
  .
  &lt;/script&gt;
  </code></pre>
  
  <p>To use it in another jsp file, I also made a function like getVar() in the same file as shown above. How can I call this function getVar() in another jsp file?</p>