Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2004, 06:40 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default time delay

Is it possible, to make a time delay within asp, what i want to do is for the script to run, and display an update complete message, wait for about three to four seconds and then run a vb script function: window.history.back();

can i do this, and if so can you help?

cheers

 
Old January 29th, 2004, 07:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

window.history.back() will run on the client side, its nothing to do with asp.

Simplest way is to use the client-side JS function setTimeout() to run the window.history.back() command. For a 3 second delay after the page has loaded in the browser, the syntax would be:
<body onload="setTimeout('window.history.back()', 3000);">
 
Old January 29th, 2004, 05:16 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Right after you post a message (or do one of many other operations on this forum) you get an operation completed message. Within several seconds you are sent back to where you were. If you are quick enough, you can view the HTML source of the page and see how it's done. You'll find buried in the HTML a tag that looks something like this:

    <meta http-equiv="Refresh" content="2; URL=http://p2p.wrox.com/">

Usually this is in the <head> tag but it works in newer browsers in other places. (Perhaps it's always worked outside of the <head> tag, but the <head> tag is the most appropriate place for it.)

That will also perform a timed redirect.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Time delay in BizTalk - Verastream Interface benvictor Biztalk 0 July 15th, 2008 04:20 PM
Loop a select but with a delay between each try chubnut SQL Server 2005 1 June 11th, 2008 06:26 AM
Menu Control Delay rit01 ASP.NET 2.0 Basics 0 June 29th, 2006 03:48 PM
How i can insert specific delay time in microsseco eakkaluck Visual C++ 1 November 2nd, 2005 05:52 PM
Missing time part while calculating the Delay happygv SQL Language 2 October 29th, 2003 11:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.