-1
I have this code that he does almost that. The only problem is that I the user needs to click on a link so that the main window gets in front. I want you to automatically open the Window behind the main window.
This is the code that opens the Window.
<script type="text/javascript">
$(document).ready(function () {
window.name = "parent";
$('#link').click(function (event){
event.preventDefault();
window.open('filho.php', 'fullscreen=yes', 'scrollbars=auto');
});
});
</script>
<body>
<a id="link" href="/">Open Window </a>
</body>
This is the code that goes back to page by clicking on the link.
<script type="text/javascript">//<![CDATA[
$(document).ready(function () {
$('#link').click(function(event){
event.preventDefault();
console.log(window.opener.location);
var goBack = window.open('', 'parent');
goBack.focus();
});
});//]]>
</script>
<body>
<a id="link" href="#">Return to Parent </a>
</body>
CODE LINK WORKING: http://pontodosjogos.com/testegrana.php
ever thought of using Modals for that? is aesthetically better and more usual, link if you are interested: http://getbootstrap.com/javascript/#modals
– Bia
My case I needed to open the contents in a window. @Bia
– Murilo