"Martin Honnen" <Ma***********@t-online.de> wrote in message
news:3F**************@t-online.de...
If you declare
var varName;
outside of any function then you have declared a global variable which
you can then use as
varName = expression
Thanks Martin,
I'm aware of what you are saying, but the problem I'm having is that unless
I initialize the var (var varName = "someValue"), the variable remains null,
or undefined. In the code below, when "text" is assigned to "print", it is
not global, and "print" retains the value of "null".
Thanks for the help,
Sam
var print="null";
function testWindow(text) { //called by first page
print = text;
alert("first -" + print)
var newWin;
newWin = window.open("dataPage.html","", "height=80,width=250");
}
function passVar() { //called by pop-up page
alert("second function -" + print);
document.write(print);
}