Solved

Refreshing the parent window from the child window

Posted on 2013-05-30
8
585 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

632 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