aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Problems in acessing parent window from child Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problems in acessing parent window from child" Watch "Problems in acessing parent window from child" New topic
Author

Problems in acessing parent window from child

Ayan Biswas
Ranch Hand

Joined: Jul 10, 2010
Posts: 104

In the above code when I click on the "create new window" button I get a new window consisting of a table with 4 cells each of different color.When I click on a particular cell I want the parent's background is colored by the same but all I get is that the new window's background color changes...I also tried parent.window.document.bgColor but still no change


AyanBiswas
Ayan Biswas
Ranch Hand

Joined: Jul 10, 2010
Posts: 104
document is the root node of any html page...so I tried document.bgColor()...but still the child windows background changes when I use it inside newWin.document.write()...Why??please help.....
vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129

for changing any settings in the parent window from child window you have to use window.opener. to access the parent document ...!!!
so if you want to change bgcolor property of parent use



in your javascript function... which will change your parent window bgcolor to red......


VIJINDAS
Ayan Biswas
Ranch Hand

Joined: Jul 10, 2010
Posts: 104
@vijin das THANks....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems in acessing parent window from child