| Author |
Problems in acessing parent window from child
|
Ayan Biswas
Ranch Hand
Joined: Jul 10, 2010
Posts: 95
|
|
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: 95
|
|
|
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: 95
|
|
@vijin das THANks....
|
 |
 |
|
|
subject: Problems in acessing parent window from child
|
|
|