I have some properties in an object that I would like to add to the global namespace. In javascript on the browser I could just add it to the window
object like so:
You could just define your own window
object as a top-level variable:
var window = {};
You can then assign values to it as you please. ("window
" probably isn't the best variable name in this situation, though.)
See also: Can I create a 'window' object for javascript running in the Java6 Rhino Script Engine