title: Loaded javascript function is undefined
body: <p>I am sure the answer to this is simple but I have researched possible answers for hours with no luck.</p>
  
  <p>I am trying to call a JavaScript addToHomeScreen function from onClientLoad (Client Side script) which is loaded but I get the ReferenceError: addToHomeScreen is not defined.  The script loads from our script library and it does load.</p>
  
  <p>My Custom Control source code:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"&gt;
          &lt;xp:this.resources&gt;
  
              &lt;xp:script src="/addToHomeScreen.js" clientSide="true"&gt;
              &lt;/xp:script&gt;
  
          &lt;/xp:this.resources&gt;
  
          &lt;xp:eventHandler event="onClientLoad" submit="false"&gt;
              &lt;xp:this.script&gt;&lt;![CDATA[addToHomeScreen()]]&gt;&lt;/xp:this.script&gt;
          &lt;/xp:eventHandler&gt;
      &lt;/xp:view&gt;
  </code></pre>
  
  <p>return:</p>
  
  <pre><code>    &lt;script type="text/javascript" src="/web3/website.nsf/addToHomeScreen"&gt;&lt;/script&gt;
  ....
  ....
  &lt;script type="text/javascript"&gt;
   function view__id1__id4__id5__id7_clientSide_onClientLoad(thisEvent) {
  addToHomeScreen()}
  </code></pre>
  
  <p>Any ideas?  I have also tried to call it from afterPageLoad (server side) </p>