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

Q907 How can I open a popup window - once only - when my frameset loads?

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

The easiest thing to use is the Framesets onLoad event handler:

<html>
<head>
<script language="JavaScript"><!--
var windowHandler = null;

function openWindow() {
    windowHandler = window.open('http://www.irt.org','windowName','width=640,height=480');
}
//--></script>
</head>

<frameset cols="50%,*" onLoad="openWindow()">
<frame src="pagea.htm">
<frame src="pageb.htm">
</frameset>

This way the window will be opened when the complete frameset loads first time. If the user navigates your site within the frames then the popup will not load again.

©2018 Martin Webb