[Javascript] window.close not working

Kim Hoogenberg kim.hoogenberg at virgil.nl
Mon Dec 6 03:16:52 CST 2004


Hello,

setTimeout takes msec as second argument. Putting 5,000,000,000,000 
msecs there will take you about appr. 58000 days to let the script be 
executed. First try using some other number like 5 seconds (5000 msecs).

Hope this helps,

Kim

>  
>
> Hi,
>
>  
>
> I have 2 windows, on button click of my 1rst window, I call the 2^nd 
>  window, which basically tracks button click & executes
>
> A script to write to the database.
>
> In the 2nd window I am calling a js file, which writes data to the db.
>
> This works fine but I only want the window which calls the script 2 be 
> opened for a few seconds.
>
> So after the script I have a window.close(). It does not write to the 
> database with the window.close.
>
> So I put a setimeout() on my second window but it still does not write 
> 2 the database. If I remove the window and manually close the window 
> it writes.
>
>  
>
> *Window1*
>
> function srcLd()
>
> { 
> window.open("ButtonClick.aspx","","width=1,height=1,top=700,scrollbars=0,menubar=0,toolbar=0,location=0,status=0");
>
>  }
>
>  
>
> *Window2 (This is all window2 has and I need it open for a few 
> seconds, execute test.js which writes ordervalue to the db and then 
> automatically close)*
>
>  <form name="test">
>
>                         <input type="text" name="orderValue" value="999" >
>
>             </form>
>
> <script type="text/javascript" src="https://test.js"></script>      
>
>  
>
> <script language="javascript">
>
>             
> setTimeout(self.close(),5000000000000)                                 
>
> </script>
>
>  
>
> Please assist.
>
> jess
>
>  
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript
>  
>




More information about the Javascript mailing list