Refreshing a frame in the parent widnow from child window
muuppal
Status: New User - Welcome
Joined: 18 Apr 2006
Posts: 1
Reply Quote
Hi, I would like to refresh the frame within a parent window from teh child window. How do i achieve this?
I do not know the frame name in the parent widnow.

thanks,
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
something like this would work but it will create an endless reload loop unless you create a function with this content and then call that function when a specified action occurs:

:: Code ::
<script type="text/javascript">
reload_parent = window.parent.location;
window.parent.location = reload_parent ;
</script>

There's really no way to reload the parent from the child I think withough creating that loop, because each time you reload the parent it in turn will reload the child, which will reload the parent, and so on.

If you want this to happen in response to a unique event, that would be ok, but if it happens on load, these are the problems you'd face.

You could set a cookie, but that is a bad idea, because if someone visits the page with cookies off and javascript on, the loop happens and can't be stopped.

Put this in the list of: bad ideas that seemed good before you thought it through.

You can execute this with lots of checking, set and check cookies, or you can just forget that idea in the first place and move onto something more constructive.

But if it gets reloaded on say a form submission or something, that would be fine.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours