homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Change div in parent window
Error ..... Has no properties

 5:18 pm on Mar 19, 2007 (gmt 0)

I currently have a page that runs a function to open a popup window:

function StartApp() {

window.open('login.asp','', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=750,height=550,left=100, top=100');
document.getElementById("launcher").style.zIndex = 1;
document.getElementById("running").style.zIndex = 2;


This function opens the window and changes the z-index of two divs on this page. This all works fine.

In the popUp window I have this code:

function cleanUp() {
parent.document.getElementById("running").style.zIndex = 1;
parent.document.getElementById("launcher").style.zIndex = 2;

This function is called in

<body onunload="javascript:cleanUp();">

But it doesn't change the z-index on the parent window when I close the popUp.

I get an error message in firefox saying:

Error: document.getElementById("running") has no properties

Any one know what I am doing wrong? or is this possible?



 8:05 pm on Mar 19, 2007 (gmt 0)

I did not try this before (disclaimer ;), but what if to try window.opener... instead of parent...?


 8:19 pm on Mar 19, 2007 (gmt 0)

I've just tried this with fontSize and color, and it worked.


 11:32 am on Mar 20, 2007 (gmt 0)

Thanks a bunch Moby_Dim,

window.opener.document.... worked perfectly

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved