Popup Closed by Third Window

[Total: 0    Average: 0/5]

There are 3 files. save them into the same directory (folder) then

Body Code:

There are 3 files. save them into the same directory (folder) then
run the first file. click on it and watch.
The third file will close the popup window.

<!--
1. this file is the first file - call it whatever you want

<script language="JavaScript"> 
function JF_openWin(htmlpage,pagename,x,y){ 
    x = 200; 
    y = 300; 
    ppts ="width="+x;
	ppts+=",height="+y;
	ppts+=",location=no";
	ppts+=",titlebar=no";
	ppts+=",screenX=0px";
	ppts+=",screenY=0px";
	ppts+=",alwaysRaised=yes";
	ppts+=",fullscreen=no";
	ppts+=",top=0";
	ppts+=",left=300";
	ppts+=",scrollbars=yes";
    NewWin = window.open(htmlpage,pagename,ppts); 
	setTimeout('document.f1.submit()',5000); /* this just allows 5 seconds to pass before it goes on */
  } 
</script> 
</head> 
<body> 
<form name=f1 action="final.html"> 
<input type="button" name="btnCarDet" value="Car Details" onclick="JF_openWin('carselinterim.html','abc',200,300);" > 
</form> 

-->

<!--
2.window that shows the message (carselinterim.html)

<html> 
<head> 
</head> 
<body> 
<div class="label">Please Wait...Collecting data</div> 
</body> 
</html> 
-->


<!--
3.window that is the final page (final.html)

<HTML> 
<HEAD> 
<script language="JavaScript"> 
var NewWin=null;
function findClose(){ 
    NewWin = window.open("","abc"); 
	NewWin.document.open();
	NewWin.document.write("<html><head></head><body>going to close this window now...</body></html>");
	NewWin.document.close();
	NewWin.focus();
	setTimeout('NewWin.close();',5000); /* just wait for 5 seconds */
  } 
</script> 
<script>
/*
function killError(){return true;}
onerror=killError;
*/
</script>
</HEAD> 
<BODY onload="findClose();"> 
This is a final Page 
<h2> 
Final Page 
</h2> 
</BODY> 
</HTML> 

-->

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *