Subj : Re: Asynchronous script execution To : netscape.public.mozilla.jseng From : "Michael Putters" Date : Thu Nov 20 2003 10:59 pm Well, that I understand, but isn't there a function JS_ExecuteScript that keeps it in memory, then I can just call functions inside it from C? Even using threads, I don't mind :) "Brendan Eich" wrote in message news:3FBD100C.1000705@meer.net... > 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 > .