Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could someone look at this code and point out my stupidity?

Status
Not open for further replies.

ironyx

Technical User
Nov 13, 2001
134
0
0
US
<html>
<head>
<title>New Page 1</title>
<script language=&quot;Javascript&quot;>
newWindow=window.open();
var theURL='quality message.htm';
var width = 300;
var height = 400;

function popWindow() {
newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height+');
}
</script>

</head>

<body onload=&quot;popWindow()&quot;>

</body>

</html>

I am not very efficient in Javascript so please excuse very obvious mistakes! I appreciate any time taken to help!!!
Thanks,
ironyx
 

height+'');
^

done


<html>
<head>
<title>New Page 1</title>
<script language=&quot;Javascript&quot;>
newWindow=window.open();
var theURL='quality message.htm';
var width = 300;
var height = 400;

function popWindow() {
newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height+'');
}
</script>

</head>

<body onload=&quot;popWindow()&quot;>

</body>

</html>
 
Okay no errors. Thank you! Now I have the new window, but shouldn't it be directed to my quality message.htm or am I missing some part out of the script. Sorry if I am missing the obvious. I learn by trying to get this stuff to work.
Thanks,
ironyx
 
You have a space in your variable theURL

var theURL='quality message.htm';

try taking it out:

var theURL='qualitymessage.htm';

also, why are you calling 'window.open()' twice?
Code:
<script language=&quot;Javascript&quot;>
*****newWindow=window.open();*****
var theURL='quality message.htm';
var width = 300;
var height = 400;

function popWindow() {
******newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height+'');*******
}
I'm thinking you might want to remove the first call.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top