cranepr
07-10-2003, 08:13 AM
I have been "learning" Javascript from the book
JAVASCRIPT by Kelly Murdock.
On pages 128 and 129 I am instructed to Open A New Browser Window using this sample code:
window.open("mypage.html", "mywindow", "width=200, height=400, toolbar=no, status=no, resizeable=yes");
This part works fine......HOWEVER....
on the next page it specifically states,
"From the original Web page, you can write text to the new window. When you create a new window, one of the parameters is to give the new window a name. This name can be used to send output to the new window...and mywindow.write() writes text to a new window named mywindow."
So for my next line of code I entered:
mywindow.write("Undefined????");
and, you guessed it, when I ran that in the browser I got the error message "mywindow is undefined."
I've been up all night rearranging it in a million different ways and still get that error message.
What I have learned about Javascript so far is that errors like this are usually due to some "obvious" little thing.
Can anybody tell me what I've overlooked?
JAVASCRIPT by Kelly Murdock.
On pages 128 and 129 I am instructed to Open A New Browser Window using this sample code:
window.open("mypage.html", "mywindow", "width=200, height=400, toolbar=no, status=no, resizeable=yes");
This part works fine......HOWEVER....
on the next page it specifically states,
"From the original Web page, you can write text to the new window. When you create a new window, one of the parameters is to give the new window a name. This name can be used to send output to the new window...and mywindow.write() writes text to a new window named mywindow."
So for my next line of code I entered:
mywindow.write("Undefined????");
and, you guessed it, when I ran that in the browser I got the error message "mywindow is undefined."
I've been up all night rearranging it in a million different ways and still get that error message.
What I have learned about Javascript so far is that errors like this are usually due to some "obvious" little thing.
Can anybody tell me what I've overlooked?