Solved

Refreshing the parent window from the child window

Posted on 2013-05-30
8
583 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

738 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