admin管理员组文章数量:1355532
I can't for the life of me figure out how to import javascript files in javascript under Rhino. Basically, all I want to do is import "some file.js" and be able to use the things in scope there.
I've been trying to mess with Context.currenctContext (pileString and pileReader), but I don't understand how to get the appropriate Scope and I keep getting the exception "Cannot find default value for object" with this code:
Context.currentContextpileString("print('something')", "whatever, 0, null).exec(Context.currentContext, null)
It seems pretty silly if I can't create modules that I can then reuse in my javascript programs... Anyone know how to solve this?
I can't for the life of me figure out how to import javascript files in javascript under Rhino. Basically, all I want to do is import "some file.js" and be able to use the things in scope there.
I've been trying to mess with Context.currenctContext (pileString and pileReader), but I don't understand how to get the appropriate Scope and I keep getting the exception "Cannot find default value for object" with this code:
Context.currentContext.pileString("print('something')", "whatever, 0, null).exec(Context.currentContext, null)
It seems pretty silly if I can't create modules that I can then reuse in my javascript programs... Anyone know how to solve this?
Share Improve this question asked Feb 22, 2011 at 10:10 B TB T 61.2k36 gold badges198 silver badges210 bronze badges 1- 2 possible duplicate of JavaScript (Rhino) use library or include other scripts – Nateowami Commented Aug 4, 2015 at 4:25
1 Answer
Reset to default 7JavaScript (Rhino) use library or include other scripts
本文标签: How to import other javascript files with rhinoStack Overflow
版权声明:本文标题:How to import other javascript files with rhino - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743982044a2571123.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论