Click to See Complete Forum and Search --> : problem with close option


man
08-05-2003, 01:35 AM
Hi out there, if got a problem with this script:

--------------------------------------------------------------------

<SCRIPT LANGUAGE="JavaScript">
window.open("lang.htm","newWindow","height=680,width=900,left=50,toolbars=no,scrollbars=no,resizable=no");
window.opener = top;
window.close();
</SCRIPT>

--------------------------------------------------------------------

Some Browser [version = IE6.02.xxx] closing page before lang.htm has opened! Why? :confused:

I am using IE6.02.xxx , too, but i have no prob with that!

Khalid Ali
08-05-2003, 08:53 AM
try using a setTimeout to create a timedelay betwee opening the window and closing.

gil davis
08-05-2003, 08:53 AM
You have apparently created a race condition. Browsers will launch a process and then proceed to execute the next line of code, regardless of the completion of the launched process. It probably works on your computer because you can load the page quicker that the other people.

man
08-05-2003, 12:43 PM
Originally posted by man
Hi out there, if got a problem with this script:

--------------------------------------------------------------------

<SCRIPT LANGUAGE="JavaScript">
window.open("lang.htm","newWindow","height=680,width=900,left=50,toolbars=no,scrollbars=no,resizable=no");
window.opener = top;
window.close();
</SCRIPT>

--------------------------------------------------------------------

Some Browser [version = IE6.02.xxx] closing page before lang.htm has opened! Why? :confused:

I am using IE6.02.xxx , too, but i have no prob with that!

Thanks for the information, but could you give me anexample?

boojum
08-05-2003, 12:52 PM
will the race condition still occur if
window.open("lang.htm","newWindow"," height=680,width=900,left=50,toolbars=no,scrollbar
s=no,resizable=no");
window.opener = top;
is put into one function and
window.close();
into another?

man
08-06-2003, 05:47 AM
<script type="text/javascript">
<!--
window.open("lang.htm","newWindow","height=680,width=900,left=50,toolbars=no,scrollbars=no,resizable=no");
window.opener = top;

function setOnlineTime()
{
window.setTimeout("setOnlineTime()",4000);
}

window.close();
//-->
</script>

Would this work so that the lang.htm would have enough time to load?