-1
我需要在父窗口后面打开一个窗口,而且我没有找到任何要做的事情。 有人可以帮助我使用此代码或提示吗?父窗口后面的打开的窗口JS或PHP
Parent.php
<script type="text/javascript">
$(document).ready(function() {
window.name = "parent";
$('#link').click(function (event){
event.preventDefault();
window.open('child.php', 'fullscreen=yes', 'scrollbars=auto');
});
});
</script>
<body>
<a id="link" href="/">Open Window </a>
</body>
child.php
<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>
LINK CODE:http://pontodosjogos.com/testegrana.php
你google了吗? 试试这个问题: http://stackoverflow.com/questions/11407153/open-a-window-behind-the-current-window-using-javascript-jquery –
我尝试使用您发送给我的链接代码不工作。 @KashifUllah – Murilo
我得到了这段代码,只不过它只有在你放置一个返回链接并把函数标识为链接上的点击时才起作用。 我希望她自动回来,而不必点击任何内容。 @KashifUllah – Murilo