Subj : Here's how... I answered my own question To : netscape.public.mozilla.jseng From : Mark Turansky Date : Thu Dec 16 2004 02:34 pm HOW TO share functions across scripts and create a library: Context context = Context.enter(); ScriptableObject sharedScope = context.initStandardObjects(); String librarySource; //load this script from somewhere Object result = context.evaluateString(sharedScope, lib, "", 1,null); //executing the library script will create all the functions & global variables in the sharedScope. //this new scope has all the info that the sharedScope has, including its functions Scriptable scope = context.newObject(sharedScope); //execute some scripts with the new scope result = context.evaluateString(scope, source, "", 1,null); Scriptable scope = context.newObject(sharedScope); result = context.evaluateString(scope, source, "", 1,null); "Mark Turansky" wrote in message news:cpsad9$7vi1@ripley.netscape.com... > How can I import functions from one script into another? I'd like to create > a library of commonly used js functions. > > .