title: Issue calling a js function on load in index.html
body: <p>I wan to call a js function when the index.html loads. </p>
  
  <p>This js function is defined in main.js file. </p>
  
  <p>I am able to call it using the below way</p>
  
  <pre><code>           &lt;input type="button" value="Submit" onclick="getSecretData()" /&gt;
  </code></pre>
  
  <p>But i want this function to be called every time the index.html is loaded (instead of the button)</p>
  
  <p>I tried the below code.  Its not working. Can you please help ?</p>
  
  <pre><code>                index.html 
  
      &lt;script&gt;
          $(document).ready(function() {
  
          getSecretData();
  
  
          });
          &lt;/script&gt;
  
  
      main.js 
  
          function getSecretData(){
      var invocationData = {
          adapter: "DummyAdapter",
          procedure: "getSecretData",
          parameters: []
      };
  
      WL.Client.invokeProcedure(invocationData, {
          onSuccess: getSecretData_Callback,
          onFailure: getSecretData_Callback
      });
      }
  
      function getSecretData_Callback(response){
      alert("getSecretData_Callback response :: " + JSON.stringify(response));
      }
  </code></pre>
  
  <p>Thanks </p>