Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window Close after 5 seconds 1

Status
Not open for further replies.

checkai

Programmer
Jan 17, 2003
1,629
US
I have an asp.net app that does some validation...then fires this after a save of an entry..

Code:
function projectSaveClose() {
  alert('Project Saved Successfully!');
  window.close();
}

so instead of the alert I would like 5 seconds to go by, then close the window...

thanks,
dlc
 
Try:

Code:
function projectSaveClose() {
  setTimeout("closeWindow()",5000);
}

function closeWindow()
{
  alert('Project Saved Successfully!');
  window.close();
}

Here, I assumed you wanted the alert to appear before the closure. If you want the 5 seconds to begin after the alert statement is shut off, move it to before the setTimeout(...) call. Of course, if you don't want it at all, drop it all together.

I believe that should do it for you.

Good luck!

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top