I'd like to access a local variable globally (without changing the namespace or location of the variable). I read that I could use 'window.', but it's not working:
var myNameSpace = {
window.localVar : 'foo'
};
alert(window.localVar); // Not working
Can something like this work?
Also, I've read about the risks of global variables. If I'm nearly certain a variable's name isn't at risk to be reused, is it safe?
$myTotallyUniqueVarName