URGENT! PLEASE HELP: Change main web page from popup?
Hi,:confused:
My main web page creates the below popup. I want to click a link in my popup and have my main web page go to the url. I do not care if the popup remains open at that point or not (I'd rather it close actually).
How do I do this?
HTML Code:
<map name="Map">
<area shape="rect" onmouseover="ChangeCursor();" onmouseout="ChangeCursorBack();" coords="295, 72, 445, 95" target="_blank" style="cursor:hand" onclick="var myWindow = window.open('Flash/treeredone.asp','ORGCHART','height=600,width=800,top=0,left=0,scrollbars=no');">
</map>
Re: URGENT! PLEASE HELP: Change main web page from popup?
Your pop-up's target would simply have to point to the opener. That isn't enough code for me to see what you are doing .. is that opening the pop-up, or is that code on the pop-up ... please explain.
Re: URGENT! PLEASE HELP: Change main web page from popup?
Hello, thank you for your reply.
The code in the snippet is in the opener. In other words, the code in the snippet opens the popup.
What would the code in the popup look like to change the opener's page ?
Re: URGENT! PLEASE HELP: Change main web page from popup?
Here is a basic version
Code:
<script type="text/javascript">
function winopen(){
win = window.open('','_blank');
win.document.open;
win.document.write('<a href="javascript:" onclick="opener.location=\'http://www.google.com\'">click</a>')
win.document.close();
}
</script>
<a href="javascript:" onclick="winopen()">click</a>
Re: URGENT! PLEASE HELP: Change main web page from popup?
U can access the main page's elements from the popup by
simply replacing 'document.something' in main page's JS with 'window.opener.document.something' in popup page's JS.
a sample code would look like
window.opener.projForm.search2.value="done";
I hope this is the relevant answer