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

Q1149 How can I select which file gets loaded into a frame based on which browser is used when the frameset gets loaded?

You are here: irt.org | FAQ | JavaScript | Frame | Q1149 [ previous next ]

Try:

<script language="JavaScript"><!--
function reloadFrame() {
    if (navigator.appName == 'Netscape')
        rightFrame.location.href = 'netscape.htm';
    else if (navigator.appName == 'Microsoft Internet Explorer')
        rightFrame.location.href = 'explorer.htm';
    else
        rightFrame.location.href = 'another.htm';
}
//--></script>

<frameset rows="50%,*" onLoad="reloadFrame()">
<frame src="test.htm" NAME="leftFrame">
<frame src="about:blank" NAME="rightFrame">
</frameset>

©2018 Martin Webb