Subj : Re: Asynchronous script execution To : netscape.public.mozilla.jseng From : "Michael Putters" Date : Thu Nov 20 2003 12:15 am "Brendan Eich" wrote in message news:3FBBE705.1080700@meer.net... > Michael Putters wrote: > > >Hello, > > > >I've just started embedding SpiderMonkey within my application, and so far, > >it's great, but I'm wondering how I could do the following : > > > >function example() > >{ > > Windows.MessageBox( 'hello world' ); > >} > > > >Application.onStartup = example; > > > >The part about calling the message box or calling the event is not a > >problem. However, I use JS_ExecuteScript. So I cannot, like.. execute it, > >THEN call onStartup from the host application. How could I do that? Not sure > >I'm being clear.. > > > > > > 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.. .