Solved

Refreshing the parent window from the child window

Posted on 2013-05-30
8
578 Views
Last Modified: 2013-06-04
Part of my website has pages which are loaded in a frame.  For iPhones and iPads, I need to reset the viewport to "scale=1" when a visitor navigates away from a child window.  The parent window has that viewport attribute (initial-scale=1) in a meta tag, but I can't get it to apply when the browser navigates among the child windows.  For example if the user zooms in on a child window, and then uses a link to another child window, the zoom is carried forward to the next child window, instead of resetting the viewport to original  scale.  Here is the code I've placed in the child window, which isn't working:

<script language="javascript" type="text/javascript">
function refreshParent()
{
    window.opener.location.reload(false);
}
</script>
</head>

<body onunload="javascript:refreshParent()">
0
Comment
Question by:ddantes
  • 3
  • 2
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39210596
0
 

Author Comment

by:ddantes
ID: 39211512
Thank you.  This is a slightly different situation, and I believe it has been fixed as of iOS 6.  

Having done more research since posting this question, I think the issue is that the child windows are in a parent window iFrame.   Meta tags which control viewport behavior in the child windows don't seem to be implemented.  So I placed the viewport meta tag in the parent window, but I don't know how to refresh that main window from the child window, without reloading the child, and then the parent, in an infinite loop.

I've read some articles, but they are quite difficult to comprehend, and I'm clueless about how to apply them.  Here is a link to one of them: http://www.webdeveloper.com/forum/showthread.php?58481-Refresh-main-page-from-iframe

 If someone could provide code to refresh only the main parent window, without the iFrame, when the child window is loaded, that could resolve this.
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 39218772
well the iframe is part of the parent window - so reloading the parent window will also reload the child iframe.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:ddantes
ID: 39219648
Thank you, and I understand.  I thought there were methods to refresh only part of the parent window.  I've read some posts about that, but don't know how to implement it in this case.  There is a link to one such article in my previous comment ID39211512.
0
 
LVL 25

Accepted Solution

by:
dgrafx earned 500 total points
ID: 39219729
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 39219865
good luck!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
Read about why website design really matters in today's demanding market.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now