Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1571 How can I prevent a popup window being reloaded if the main page is refreshed or reloaded?

You are here: irt.org | FAQ | JavaScript | Window | Q1571 [ previous next ]

Use the following, which creates the popup window, and reuses any of the same name, and then only loads a page into the popup window if the popup window dows not already contain the page:

<script language="JavaScript"><!--
var WinId = window.open('','newwin');
if (WinId.location && WinId.location.href.indexOf('mypage.html') == -1) WinId.location.href = 'mypage.html';
//--></script>

©2018 Martin Webb