Friday, July 31, 2009

Window parent handler!!!

If there is a need to perform any operation in a parent window w.r.t the actions or events performed in the child window , but without refreshing the parent window , javascript comes in handy with its window.opener functionality.You can set/alter the values of the javascript variables in the parent window from the child window.You can also excecute the javascript functions of the parent window from the child window.Using this you can play with the entire DOM elements of the parent window.

For example,

window.opener.parent_variable1='XXX';
window.opener.parent_variable2=false;
window.opener.parent_function1();

PS :
Why did i write this?
Bcoz i will forget it in another 2 days.
And why did i write this (negligible)technical post?
Need to find the answer....
Will it be a start to write technical posts?
Should wait and see....

No comments: