• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems in acessing parent window from child

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....
 
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@vijin das THANks....
 
reply
    Bookmark Topic Watch Topic
  • New Topic