This content has been marked as final.
Show 2 replies
-
1. Re: How to share javascript variable for two different window?
nbelaevski Jul 1, 2010 6:40 PM (in response to eswaramoorthy1985)Hi,
You can use window.opener to access variables of parent window: https://developer.mozilla.org/en/DOM:window.opener
-
2. Re: How to share javascript variable for two different window?
eswaramoorthy1985 Jul 1, 2010 9:55 PM (in response to nbelaevski)Hi,
Here i change my code in newWindow.jsp and count.js
newWindow.jsp
<input type="button" value="Test" onclick="opener.countTestButtonClick()"/> <input type="button" value="ClickedCount" onclick="opener.getTestButtonClickedCount();"/> <input type="button" value="ClickCount-Close" onclick="opener.getClickedCountAndClose();"/>
count.jsfunction getClickedCountAndClose() { alert("Total Number of clicked : " + clickCount); javascript:window.close(); }
Here i add one more method for get the clicked-count and close this window.
But,i got only the clickedcount, not close this opened window.I don't know, i use opener right way.