0
   

parent tab(window) to child tab(window) to parent tab(window)

 
 
Reply Wed 19 Dec, 2012 02:13 am
This question is javascript.

Parent window(tab) link to child windw(tab).
then child window(tab) will link to parent window(tab).

I writed code.
My code can run only chrome.
My code can't run ie9 and firefox 4.

Ask idea to run my code ie9 and firefox 4.

below my code.

1.Parent<index.html>

<html>
<head>
<title>TOP page</title>
<script type="text/javascript">
<!--

var win;

function disp(url){


win = window.open(url, "pa");

}


// -->
</script>

</head>
<body>

<p><a href="example_sub8.html" target="_blank" onClick="disp('example_sub8.html')">open sub window</a></p>

</body>
</html>

<example_sub8.html>

<html>
<head>
<title>test sub window</title>

<script type="text/javascript">

<!--

function disp(url){

if(!window.opener || window.opener.closed){

window.alert('Main Window not exist');

}
else{

window.blur();
window.opener.focus();
window.open(url,"pa");
//window.opener.location.href = url;


}

}



// -->
</script>

</head>
<body>

<ul>
<li><a href="#" onClick="disp('index.html'); return false;">top page</a></li>
<li><a href="#" onClick="disp('index2.html'); return false;">test2 page</a></li>
</ul>


</body>
</html>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 2,460 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » parent tab(window) to child tab(window) to parent tab(window)
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/14/2025 at 07:21:14