title: How to call javascript method from android
body: <p>Hi In my android phonegap app i need to call the javascript method from android code (DroidGap).I have tried the sample code.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>super.loadUrl("file:///android_asset/www/index.html");
  super.loadUrl("javascript:onload()");
  </code></pre>
  
  <p>When i use super.loadUrl("javascript:alert('hai')"); i am getting this alert.But when i use the method "onload" i am getting the error.</p>
  
  <p>Here is my error in logcat:</p>
  
  <pre><code>Uncaught TypeError: Property 'onload' of object [object DOMWindow] is not a function at null:1
  </code></pre>
  
  <p>Here is my script in index.html:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
   function onload()
   {
       alert("hai");
   }
   &lt;/script&gt;
  </code></pre>
  
  <p>I dont know where i am wrong.Please guide me.Thanks in Advance.</p>