First, I am a little confused about this and whether this is an appropriate approach. I have put this together so far. What it does is display a different html page into the IFrame based upon if the person clicks the link. However, this is not what I want to do. What I want to do, is if Windows XP is detected to display load1.html into the Iframe and if Windows Vista is detected to display load2.html into the iframe. Any help would be greatly appreciated. Thank you!
[CODE]<script type=”text/javascript”>
document.write(“<p>Browser’s user agent header: “);
document.write(navigator.userAgent + “</p>”);
if (navigator.userAgent.indexOf(“Windows NT 5.1”) > -1)
document.write(‘WINDOWS XP DECTECTED’)
else if (navigator.userAgent.indexOf(“Windows NT 6.0”) > -1)
document.write(‘WINDOWS Vista DECTECTED’)
else
document.write(‘No Os Detected’);
function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
return true;
}
</script>
<a href=”load1.html” onclick=”return loadIframe(‘ifrm’, this,href)”>Page 1</a>
<a href=”load2.html” onclick=”return loadIframe(‘ifrm’, this.href)”>Page 2</a>
<div class=”iframe”>
<iframe name=”ifrm” id=”ifrm” src=”load1.html” frameborder=”0″>Your browser doesn’t support iframes.</iframe>
</div>