HighDots Forums  

checking parent's URL ?

Javascript JavaScript language (comp.lang.javascript)


Discuss checking parent's URL ? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mel
 
Posts: n/a

Default checking parent's URL ? - 02-16-2005 , 01:31 PM






how can i check parent's URL from a child (popup) window ? and how can i
refresh it if the URL is say http://www.xxx.com/ ?

thanks



Reply With Quote
  #2  
Old   
jen_designs@hotmail.com
 
Posts: n/a

Default Re: checking parent's URL ? - 02-16-2005 , 03:42 PM






<script language="javascript">
myURL = window.opener.location.href
if (myURL == "http://www.xxx.com/")
{
window.opener.location.reload()
}
</script>

This only owrks if you opened the pop up using the window.open function.


Reply With Quote
  #3  
Old   
Randy Webb
 
Posts: n/a

Default Re: checking parent's URL ? - 02-16-2005 , 05:24 PM



jen_designs (AT) hotmail (DOT) com wrote:
Quote:
script language="javascript"
Language attribute is deprecated.

<script type="text/javascript">

Quote:
myURL = window.opener.location.href
if (window.opener)
myURL = window.opener.location.href;
//the above line fails if window.opener
//is from a different domain from the
//current page.

Quote:
if (myURL == "http://www.xxx.com/")
{
window.opener.location.reload()
}
/script

This only owrks if you opened the pop up using the window.open function.
It only works if you opened the popup using window.open *and* the two
pages are in the same domain.

But, quoting what you are replying to *always* works and lets people
know what you are replying to. Read all about it in the group FAQ.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.