title: gwt calling java function from hand written javascript
body: <p>This is with reference to this example:</p>
  
  <pre><code>package mypackage;
  
  public MyUtilityClass
  {
      public static int computeLoanInterest(int amt, float interestRate,
                                        int term) { ... }
      public static native void exportStaticMethod() /*-{
        $wnd.computeLoanInterest =
        $entry(@mypackage.MyUtilityClass::computeLoanInterest(IFI));
      }-*/;
  }
  </code></pre>
  
  <p>I need to know the javascript code to call this function. If I use <code>&lt;input type="button" onclick=computeLoanInterest(1,2.1,1)/&gt;</code> the example works, but <code>var x = computeLoanInterest(1,2.1,1) does not work</code>. Can someone tell me what am I missing here.</p>
  
  <p><code>var x = computeLoanInterest(1,2.1,1);</code> makes value of x undefined
  <code>var x = window.computeLoanInterest(1,2.1,1)</code> shows type mismatch error</p>
  
  <p>Thanks
  Ravi </p>