Yes it is possible (if I correctly understand your question). Here is the code I have in my library for it.
Code:
/* global eval code based on blog post on ajaxian written by Joseph Smarr */
exfer.evalCodeToGlobal = function (sJSCode) {
if (window.execScript) {
window.execScript(sJSCode);
return null;
}
var globalNamespace = this;
return(globalNamespace.eval ? globalNamespace.eval(sJSCode) : eval(sJSCode));
};
david_kw