title: How to call a function from another HTML page?
body: <p>I want to call a function from another HTML web page I create.</p>
  
  <p>If the second Javascript function is this: </p>
  
  <pre><code>function g(x){
     alert(x);
  }
  </code></pre>
  
  <p>So I tried this in the first page:</p>
  
  <pre><code>function f(){
      var x = prompt("enter");
      testwindow = window.open("otherWebPage.html", "_self");
      testwindow.g(x);
  }
  f();
  </code></pre>
  
  <p>but its not working. Where did I go wrong?</p>
  
  <p>(it's not really my code in the page, i just gave a simple example)</p>