File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems in acessing parent window from child

 
Ayan Biswas
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Ayan Biswas
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
Firefox Browser Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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......
 
Ayan Biswas
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@vijin das THANks....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic