Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 August 12th, 2004, 03:54 AM
Authorized User
 
Join Date: Jul 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sherbir
Default Implementing setTimeout causing problems

I have used a simple application.

A main window creates a child window at the click of a button.

In the child window, I am performing some operations and thru Javascript, I am closing the child window, and submitting the parent.

I want the submitting of parent window to take place 3 seconds after closing the child. Here's my code 4 the Javascript in the child :

mywin.document.write('<input type="submit" name="child_bttn_sub" value="Done" onClick= "javascript:self.opener.history.back(-1);self.close();setTimeout(window.parent.SubmitCon tent(),3000);">');

Here mywin is the child window object and SubmitContent() is the function in the parent form that I wish to execute.

It's not working...any1 has a clue ?

Regards,
Sherbir
__________________
Regards,
Sherbir
 
Old August 12th, 2004, 09:47 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Sherbir,

I'm not sure exactly what you are trying to do, but in the following code...
Code:
self.close();setTimeout(window.parent.SubmitContent(),3000);
The function call in setTimeout will never get executed, because you are closing the window you are setting the timeout in.

In addition (I may have the wrong end of the stick here) window.parent refers to a window higher up a frameset & I think you are trying to access the window that opened the one with the code in, so you need to use window.opener instead.

HTH,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
setTimeOut with a zero parameter? calgarychinese ASP.NET 1.0 and 1.1 Basics 3 April 5th, 2007 08:44 PM
Todays Microsoft Update causing flash big problems larry Flash (all versions) 4 May 9th, 2006 06:18 PM
loadMovie causing window status problems Snib Flash (all versions) 0 July 21st, 2004 06:32 PM
<href> causing problems mahulda ASP.NET 1.0 and 1.1 Basics 5 July 15th, 2004 12:15 PM
Using setTimeout PortGuy Javascript 7 March 25th, 2004 02:06 PM





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