Subj : Re: Asynchronous script execution To : Michael Putters From : Brendan Eich Date : Thu Nov 20 2003 11:03 am Michael Putters wrote: >"Brendan Eich" wrote in message > > >>See JS_CallFunctionName and related APIs. >> >>/be >> >As I said, I have no problem calling the function, but right now it's like >this : > >Application.onStartup = function() >{ > Windows.MessageBox( 'hello world' ); >} > >main(); // some global function I provide that will call onStartup > >I'd like to get rid of main... >I can't call onStartup before JS_ExecuteScript, but I can't call it after >JS_ExecuteScript either.. > > Why not? You can't have it both ways. Either you need a separate script containing the Application.onStartup = function(){...}, or you need an enclosing syntax (such as HTML affords with ) to define the onStartup function. /be .