Click to See Complete Forum and Search --> : Why this simple script dont work?


Johanvh
12-04-2003, 09:04 AM
<html>
<head>
<script language="javascript">
popup="window.open('http://www.maeselectronics.be/form/feedback.htm','Windowname',
'width=300,height=550,scrollbars=no,toolbar=no,location=no'); return false"
</script>
</head>
<body onload="popup()">

Bla bla bla

</body>
</html>

What is wrong?
When I leave the attributes it works but I want to set the size of the window.

Thanks

bsd12673
12-04-2003, 09:22 AM
You're calling a function in your onLoad statement but you don't have a function defined in your javascript.
You need to do

function popUp() {
window.open('http://www.maeselectronics.be/form/feedback.htm','Windowname','width=300,height=550,scrollbars=no,toolbar=no,location=no');

}

<body onload="popUp()">

requestcode
12-04-2003, 09:23 AM
I believe it is because you are placing in within double quotes. Try this:
popup=window.open('http://www.maeselectronics.be/form/feedback.htm','Windowname',
'width=300,height=550,scrollbars=no,toolbar=no,l
ocation=no');

Not sure why you have the return false.

fredmv
12-04-2003, 10:16 AM
<script type="text/javascript">
onload = function()
{
window.open('http://www.maeselectronics.be/form/feedback.htm', 'child', 'width=300,height=550');
}
</script>