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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

target window open on a timer

Status
Not open for further replies.

mak2112

IS-IT--Management
Aug 8, 2001
46
I am doing a website that needs to interact with my database server in order to look up info. I want to have a new target box open, during the communication, that will state something like "thanks for waiting". I want to set this target window to exist for a specific period of time, or to disappear once communication with the database is done. Is this possible, and if so, any ideas on how to do it.

thanks

marc
 
Use window.open and window.close with javaScript settimeout() functions. Try the javascript forum. It would be a set amount of time rather than just waiting for the database to respond. Thise guys are all guru's, give them a shot DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Hi Marc,

Put this code in the <body> of your page that opens the new popup-window:
(It opens a popup-window in the middle of your screen)

<script language=&quot;javascript&quot;>

var h = '250';
var w = '274';
var winl=(screen.width - w) / 2;
var wint=(screen.height - h) / 2;

window.open('popup.htm', 'popup-name', 'height='+h+',width='+w+',top='+wint+',left='+winl+'');

</script>

Put this code in the <body> of your popup-window page:

<script language=&quot;javascript&quot;>

timer = setTimeout(&quot;window.close();&quot;, 4000);

</script>

You can also make functions like:

<script language=&quot;javascript&quot;>
function timeclose()
{
timer = setTimeout(&quot;window.close();&quot;, 4000);
}

</script>

and start the function with :

<body onload=&quot;javascript:timeclose();&quot;


Hope this helps,
Erik
 
Hi Marc,

Maybe I'm confusing with saying &quot;Put this code in the <body> of ..&quot; because at the end I show the 'onload' attribute in the body tag

So with &quot;Put this code in the <body> of ..&quot; I mean in the <body></body> part like:

<body>
<script language=&quot;javascript&quot;>
....
</script>
</body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top