Subj : Re: [rhino] constructing functions from a code snippet To : Michael Gratton From : Igor Bukanov Date : Mon Dec 08 2003 08:32 am Michael Gratton wrote: > > Guys, > > Is there a better way to construct an instance of Function when you only > have the body of the function than what I'm doing currently, which is: > > function = cxt.compileFunction(scope, > "function (arg1) {" + script + "}", > ...); > > This is for executing something like a HTML inline event handler. > You can not do any better then that. Note that for compatibility function's argument should be called event, not arg1. Regards, Igor .