Adding Other Libraries to Context

Jan 5, 2014 at 5:27 AM
I am sure I am missing something easy, but how would you add a library, say Underscore.JS, to the context so that your script would have access to the functions and objects within that library? I have looked at the documentation and cannot figure out the best way to do it.

For example, in my script, I would like to be able to use Underscore like you would normally if you include the Underscore library in a web page.

I think the solution involves somehow passing in the library as a context variable. But it is not clear how I would do that.

I appreciate any guidance you can provide.

Jan 5, 2014 at 8:50 PM
I would think you could load the entire source code into a string and then invoke Run() with the string. It would leave itself behind by way of global variables available to subsequent calls to Run().