.NETGURU
Why setTimeOut() don't work
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngclient' list.


li
WebClient.UploadFile Method and Error 405I want to close my child window after Several second. I try to use
SetTimeout('ChildWindow.close()',8000) but It don't work ?

What wrong for my code ?
Reply to this message...
 
    
Jose Fuentes
WebClient.UploadFile Method and Error 405I want to close my child window after Several second. I try to use
SetTimeout('ChildWindow.close()',8000) but It don't work ?

What wrong for my code ?
Reply to this message...
 
    
li
On my server side code:

I do that :

Dim sScript as string
sScript = "win=window.open('page1.aspx');"
sScript = sScript & "win.print();"
sScript = sScript & "win.setTimeout('win.close();',2000)"
btnPrint .attribute.add("onclick",sScript)

if I changed the sScript = sScript & "win.close();)"
My child window can close but I need some time delay.

Any idea ?

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Friday, July 19, 2002 9:38 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
Jose Fuentes
setTimeout('win.close(',2000)

Anyways if I remember right settimeout is it's own function in js and not a
member of window.

<script>
function hi(){
alert('HI');
}
setTimeout('hi()',5000);
</script>

Seems to work just fine.

-----Original Message-----
From: li [mailto:Click here to reveal e-mail address]
Sent: Saturday, July 20, 2002 12:25 PM
To: aspngclient
Subject: [aspngclient] RE: Why setTimeOut() don't work

On my server side code:

I do that :

Dim sScript as string
sScript = "win=window.open('page1.aspx');"
sScript = sScript & "win.print();"
sScript = sScript & "win.setTimeout('win.close();',2000)"
btnPrint .attribute.add("onclick",sScript)

if I changed the sScript = sScript & "win.close();)"
My child window can close but I need some time delay.

Any idea ?

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Friday, July 19, 2002 9:38 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

| http://www.aspfriends.com/aspfriends/aspngclient.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
leon jollans
setTimeout is a member of window, but the window object is implicit. =
just thought I'd clear that up.

-----Original Message-----
From: Jose Fuentes [mailto:Click here to reveal e-mail address]
Sent: 22 July 2002 13:37
To: aspngclient
Subject: [aspngclient] RE: Why setTimeOut() don't work

setTimeout('win.close(',2000)

Anyways if I remember right settimeout is it's own function in js and =
not a
member of window.

<script>
function hi(){
alert('HI');
}
setTimeout('hi()',5000);
</script>

Seems to work just fine.

-----Original Message-----
From: li [mailto:Click here to reveal e-mail address]=20
Sent: Saturday, July 20, 2002 12:25 PM
To: aspngclient
Subject: [aspngclient] RE: Why setTimeOut() don't work

On my server side code:

I do that :

Dim sScript as string
sScript =3D "win=3Dwindow.open('page1.aspx');"
sScript =3D sScript & "win.print();"
sScript =3D sScript & "win.setTimeout('win.close();',2000)"
btnPrint .attribute.add("onclick",sScript)

if I changed the sScript =3D sScript & "win.close();)"
My child window can close but I need some time delay.

Any idea ?

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Friday, July 19, 2002 9:38 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

| http://www.aspfriends.com/aspfriends/aspngclient.asp =3D JOIN/QUIT

| [aspngclient] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngclient.asp =3D JOIN/QUIT
</BODY></HTML>
[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
li
if

function hi(){
alert('HI');
}
setTimeout('hi()',5000);
</script>
work fine, the setTimeOut('window.close()',5000)should be fine. Both
window.close() and hi are fucntion . So I confused that why my child window
can't close

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Monday, July 22, 2002 6:36 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
Jose Fuentes
Well JS is case sensitive
setTimeout() not setTimeOut()

hey to test your script

make a notepad text file put
<script>
setTimeout('window.close()',5000);
</script>

then save it with a name like test.html

and open it in IE.
Since it isn't in any function or sub it will run on load of the page.
So in 5 seconds you will see the window close.

Joe

FYI: ok I was wrong about the setTimeout() not being part of window object.
I just never used it that way.

-----Original Message-----
From: li [mailto:Click here to reveal e-mail address]
Sent: Monday, July 22, 2002 11:57 PM
To: aspngclient
Subject: [aspngclient] RE: Why setTimeOut() don't work

if

function hi(){
alert('HI');
}
setTimeout('hi()',5000);
</script>
work fine, the setTimeOut('window.close()',5000)should be fine. Both
window.close() and hi are fucntion . So I confused that why my child window
can't close

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Monday, July 22, 2002 6:36 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

| http://www.aspfriends.com/aspfriends/aspngclient.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
li
Yes, It work.
But I don't know why It don't work when I use inside my control when I
changed to win.close() . win is my child window name

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Tuesday, July 23, 2002 6:43 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
Jose Fuentes
Well you don't have to have win you could just use window.close() if this
script is running in that child window.
If it is running on the parent window then childwindowname.close() should
work.
setTimeout('childwindowname.close()',5000);

hope that helps.
Joe

-----Original Message-----
From: li [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 23, 2002 8:59 AM
To: aspngclient
Subject: [aspngclient] RE: Why setTimeOut() don't work

Yes, It work.
But I don't know why It don't work when I use inside my control when I
changed to win.close() . win is my child window name

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngclient" <Click here to reveal e-mail address>
Sent: Tuesday, July 23, 2002 6:43 AM
Subject: [aspngclient] RE: Why setTimeOut() don't work

[Original message clipped]

| http://www.aspfriends.com/aspfriends/aspngclient.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
 
System.Net.WebClient




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification