Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Refreshing the parent window from the child window

Posted on 2013-05-30
8
Medium Priority
?
592 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
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!

 

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 2000 total points
ID: 39219729
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 39219865
good luck!
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

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. …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

722 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