Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Frame | Q1149 [ previous next ]

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

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.