Solved

Refreshing the parent window from the child window

Posted on 2013-05-30
8
581 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Asp in script 6 35
jQuery Toggle & Anchor Links 5 42
message Alert on an empty search 10 16
WordPress: Debugging from my Windows 10 Desktop 6 24
A professional opinion on which Apple product to buy, and a tidbit about the WWDC.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

789 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