[SPAM] - Re: [Javascript] window.close not working - Email foundin subject

Peter Brunone peter at brunone.com
Mon Dec 6 03:37:35 CST 2004


	How is the js file supposed to be executed?  Usually when one
uses the script src="file.js" syntax in HTML, it merely provides a
reference to be used by script in the page (although I realize that this
is not necessarily the case).

	Maybe in your remote javascript file, you could set a variable
after the database update is complete, and modify your setTimeout
function to check for the value so if the value was set, it would close
the window, and if not, it would go another round it its holding
pattern.

-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of Jessica

Hi,

I only want my window to close after I execute the following script.
<script type="text/javascript" src="https://test.js"></script>      

It does not seem to work, I did change setTimeout 2 5 secs but still
does not execute my test.js.
 
jess 

-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of Kim Hoogenberg

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





More information about the Javascript mailing list