By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,945 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,945 IT Pros & Developers. It's quick & easy.

checking parent's URL ?

P: n/a
Mel
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
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<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.

Jul 23 '05 #2

P: n/a
je*********@hotmail.com wrote:
<script language="javascript">
Language attribute is deprecated.

<script type="text/javascript">
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.
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?
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.