0

在我的页面上,我有以下代码:

<script type="text/javascript">
            if(!window.opener) {
                window.open(window.location.href, '_blank');
            }
        </script>

基本上在一个新窗口中打开“本身”,没有一个恒定的循环。
如何将“附加”Javascript 内容添加到它打开的新窗口,而不是原始窗口?

4

1 回答 1

2
<script type="text/javascript">
    if(!window.opener) {
        window.open(window.location.href, '_blank');
    } else {
        // ...add additional content here...
    }
</script>
于 2013-10-27T01:20:07.443 回答