Load event triggers server side script before script has loaded
<p>I have an iframe that has a onload event.  This event called a function (iframe_load) that I placed into a server side script.  It appears that when my screen is launched, the onload event is triggered before the server side script has loaded and I get an error as the function is not found.  </p>

<p>I have got around this by changing the onload event to call a checking function (iframe_check_load) in the client side script.  This checks for the existence of parameter in the server side script, where if found it will then call the original function (iframe_load).  </p>

<p>However ideally I would prefer not to have this checking funtion and to keep the client side code to a minimum.  Is there a way I can add some code to the onload event to do this check, without having to use the checking function?  </p>

<p>My current code:</p>

<pre><code>function iframe_check_load(ctrl) {
   if(typeof iframe_flag != "undefined"){
     iframe_load();                               
   }            
}

&lt;IFRAME id=iFrame2 onload=iframe_check_load() &gt;&lt;/IFRAME&gt;
</code></pre>

<p>I am sure there must be better ways to do all of this, please go easy as I'm stil learning JS!</p>

<p>Many thanks</p>

<p>Mark</p>
