Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open page in parent from link in pop-up window.. 1

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi,

I'm trying to open a page in the main (parent) window, from a link on a pop-up window but it's not doing what it's supposed to..

The pop-up window was created using the follwing javascript:

Code:
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
function helpwindow() {
			cadhelpWindow = window.open(&quot;cadhelppop.html&quot;,&quot;CADHELP&quot;,&quot;height=245,width=320&quot;)
			}
</script>

...and that works fine but I would like a link in the text on the pop-up to open the designated page back in the main parent window..

I've tried using the target=&quot;_parent&quot; tag in the link code but it only opens the page in the pop-up..

Any ideas??

Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@bpdesignz.com
 
Code:
_parent
refers to a parent frame, not a parent window.
Look at thread216-680855 to see how to do this using javascript.

Kevin
A+, Network+, MCP
 
<a href=&quot;javascript:;&quot; onClick=&quot;window.parent.location(page.htm)&quot;>take the parent page back</a>

should work

<Signature>
Sometimes the Answer You Are LOOKING for can be FOUND BY SEARCHING THE FAQ'S @&%$*#!!!
</Signature>
 
What you need to use is the

window.opener property...

Set the link in your pop-up to something like

Code:
<A href=&quot;javascript:goTo('this.html')&quot;>Link</A>
then in your javascript have a function like this...
Code:
function goTo(myLoc) {
  window.opener.location.href=myLoc
  window.close() // if you want to close the pop-up window at the same time.
}
 
melsana is correct i made a mistake

window.opener.location.href('page.htm')

works

<Signature>
Sometimes the Answer You Are LOOKING for can be FOUND BY SEARCHING THE FAQ'S @&%$*#!!!
</Signature>
 
Well not a huge java fan so Ill post answer in html.

Give both ur frames a name like
<frame src=&quot;a.asp&quot; name = &quot;leftframe&quot;>
<frame src = &quot;b.asp&quot; name = &quot;rightframe&quot;>

And then in the link write

<a href = &quot;home.asp&quot; target = &quot;rightframe&quot;>
Your popup menu would remain with the rest of your links while main page will change to new location.

I think...

Hope this helps Artanius
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top