Subj : Re: Asynchronous script execution To : netscape.public.mozilla.jseng From : "Michael Putters" Date : Fri Nov 21 2003 03:44 am Basically, my (C) application starts. At some point, everything is loaded, and I can execute the script (JS_ExecuteScript). If that happens, the script does its stuff, then exits. What I'd like is that the script remains in memory, and that I can just call events. For example, assuming such functions would exist : void startscript( void ) { handle = JS_ExecuteScriptAsync( context, somescript ); JS_CallFunction( context, global, "onStart", .. ); } void js_exit( void ) /* some function that can be called from the script { JS_StopScript( handle ); } Hope this explains a bit better. Basically, I'm wonder how a web browser can call onLoad once the script is running.. (since the execution is blocked at the JS_ExecuteScript call) "Brendan Eich" wrote in message news:3FBD75CB.20603@meer.net... > Michael Putters wrote: > > >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 :) > > > > > > What do you mean by "call functions inside it from C"? By "it", do you > mean inside JS_ExecuteScript? Exacly when is onStartup supposed to be > called, in relation to other code in the script that you compile and > execute? > > I don't understand the problem, so you'll have to state it more clearly, > or give more complete example code. > > /be > .