Subj : Re: JS_CallFunctionName doesn't work ... To : netscape.public.mozilla.jseng From : Sterling Bates Date : Thu May 13 2004 10:21 am Gregory Sovaridis wrote: > Hi there, > > Quite new to js, I'm trying to execute a javascript function (from a file) > from my C code. > I'm using the JS_CallFunctionName which returns me always 0 (zero). > > I'm pretty confident it should do it but my boss doubt this library > currently works! > Any idea ? [snip] > jsp = JS_CompileFile(cx, glob, szJSFile); > You need to call JS_ExecuteScript a) after JS_CompileFile, and b) before calling the function. All you've done here is compile the javascript. Sterling .