Dean
10-04-2002, 10:25 AM
hi there
I am trying to get a page to close the moment it has loaded a popup,
I have a bit of code that will close the window with no popup asking would i like to close the page. which is perect for the job but i can't seem to add it to the onload tag in the body tag and get it to work.
here is the code:
<html>
<head>
<title>Parent Window</title>
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="MM_openBrWindow('race.htm','race','width=400,height=380');window.Click();">
<object id=window type="application/x-oleobject"classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object><a href="#" onClick="window.Click();">Close Window</a>
</body>
</html>
If you look in the onlad tag i have put the window.Click(); bit of code from the lnk on the text that will close the page but it doesn't work.
Can anyone see where i am going wrong. I have had this working about a year ago but can't find where i did it or remeber how.confused:
Any suggestions welcome:
I am trying to get a page to close the moment it has loaded a popup,
I have a bit of code that will close the window with no popup asking would i like to close the page. which is perect for the job but i can't seem to add it to the onload tag in the body tag and get it to work.
here is the code:
<html>
<head>
<title>Parent Window</title>
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="MM_openBrWindow('race.htm','race','width=400,height=380');window.Click();">
<object id=window type="application/x-oleobject"classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object><a href="#" onClick="window.Click();">Close Window</a>
</body>
</html>
If you look in the onlad tag i have put the window.Click(); bit of code from the lnk on the text that will close the page but it doesn't work.
Can anyone see where i am going wrong. I have had this working about a year ago but can't find where i did it or remeber how.confused:
Any suggestions welcome: