Reputation: 1209
On my page I have the following code:
<script type="text/javascript">
if(!window.opener) {
window.open(window.location.href, '_blank');
}
</script>
Basically opens 'itself' in a new window, without a constant loop.
How can I add 'additional' Javascript content to the new window it opens up, and not the original?
Upvotes: 0
Views: 25
Reputation: 28718
<script type="text/javascript">
if(!window.opener) {
window.open(window.location.href, '_blank');
} else {
// ...add additional content here...
}
</script>
Upvotes: 2