Posted by: prajapatinilesh | March 28, 2008

Refresh main parent window of iframe

test.html
<html>
<head>
<script>
if(window.parent.document.getElementById(‘frameObj’)){
//window.parent.location.href=window.location.href;
window.parent.location.href=window.parent.location.href;
}
</script>
</head>
<body>
Main Iframe hello File
<iframe id=”frameObj” src=”abc.html”></iframe>
</body>
</html>
*****************
abc.html
<a href=”test.html”>click here to main iframe file</a> <br />
<a href=”nilesh.html”>click here to nilesh file</a>
******************
nilesh.html
<html>
<head>
<script>
if(window.parent.document.getElementById(‘frameObj’)) {
//window.parent.location.href=window.location.href;
window.parent.location.href=window.parent.location.href;
}
</script>
</head>
<body>
Nilesh hello File
</body>
</html>
*********************
Now for to test open -> test.html file.
which will always refresh main parent file where you put iframe.
Thanks,
Nilesh Prajapati… 🙂

Advertisements

Responses

  1. Hi,
    I’m fine.
    Taro Su che?

  2. Nice site..

  3. Nice.. it helped me lot..

  4. thank you so much..

  5. It’s Work , Thnak,

  6. Dzięki wielkie. Thanks!

  7. where did you take the picture in the main banner? It looks so pretty!!!

  8. thanks dude !!!

    I tried with
    if (self != top) {
    window.parent.location.href = window.parent.location.href;
    }

  9. For same window


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: