Click to See Complete Forum and Search --> : IE and JavaScript (window.new) problems.


pjbiv23
08-28-2003, 10:28 PM
Hi, I am a newbie and I am having problems with what should be a simple javascript. It works fine for Netscape (PC/MAC) but it does not open the second pop-up with IE (PC/MAC). Here is the script:

<script language="JAVASCRIPT">
function splash() {
window.open('index2.htm', 'newWindow', 'scrollbars=0,resizable=0,height=570,width=796');
window.open('holidaySched.htm', ':abor Day Weekend Schedule', 'scrollbars=,resizable=0,width=420,height=240,left=20,top=20');
}
</script>

pyro
08-28-2003, 10:35 PM
Not sure if it will make a difference or not, but try this:

<script type="text/javascript">
function splash() {
window.open('index2.htm', 'newWindow', 'scrollbars=0,resizable=0,height=570,width=796');
window.open('holidaySched.htm', 'Labor Day Weekend Schedule', 'scrollbars=0,resizable=0,width=420,height=240,left
=20,top=20');
}
</script>

pjbiv23
08-28-2003, 10:41 PM
Thanks, but still no difference. IE (both PC and MAC) will not open the second window. Any other ideas?

pyro
08-28-2003, 10:50 PM
Oops... my bad. Try this (the error is in the window name [second argument passed to the window.open] -- you can't have spaces)

<script type="text/javascript">
function splash() {
window.open('index2.htm', 'newWindow', 'scrollbars=0,resizable=0,height=570,width=796');
window.open('holidaySched.htm', 'newWindow2','scrollbars=0,resizable=0,width=420,height=240,left=20,top=20');
}
</script>

pjbiv23
08-28-2003, 11:13 PM
Thanks, that fixed it:)

pyro
08-29-2003, 07:04 AM
You're welcome... :)

pjbiv23
08-29-2003, 12:48 PM
What book(s) would be good to get that describes javascript? I have JAVA book by SAVITCH but it did not have any info about javascript in it (or at least I could not find it). Thanks again.

pyro
08-29-2003, 01:07 PM
Java and JavaScript are two totally different animals...

For JavaScript, I would recommend "JavaScript, The Definitive Guide" by David Flanagan, and http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/