by Ed Lazor <osmosis(at)atfantasy.com>
|
Date: |
Fri, 29 Sep 2000 18:52:52 -0700 |
To: |
hwg-style(at)hwg.org |
|
todo: View
Thread,
Original
|
|
I found someone to help me figure out what I was trying to accomplish, but
we weren't able to figure out why the code I had created caused
problems. If you know, could you send me a note to let me know?
I was trying to use javascript for browser identification and setting the
width of the window to a minimum of 780 pixels.
I've included a copy of the working code, in case people want to compare it
to what was listed in my last email.
Thanks! =)
-Ed
----------------------------------------------------------------------------------------------------------------------------------
Working Code:
----------------------------------------------------------------------------------------------------------------------------------
<script LANGUAGE="JavaScript">
<!--
document.write("Testing for fun<br>");
/*----------------------------------------------------
// Browser Detect
//--------------------------------------------------*/
if (document.all || document.layers) {
if (navigator.appName == "Netscape") {
isNav = true;
} else {
isIE = true;
}
}
/*----------------------------------------------------
// Browser Width Detection
//--------------------------------------------------*/
var scrnWidth = (document.all ? document.body.clientWidth :
window.innerWidth);
document.write("Screen Width = " + scrnWidth + "<br>");
if (scrnWidth > 781)
scrnWidth = scrnWidth - 20;
else
scrnWidth = 780;
document.write("Screen Width = " + scrnWidth + "<br>");
document.write("<table border=0 width="+scrnWidth+"
height=1><tr><td></td></tr></table>");
document.write("Testing around the world<br>");
// -->
</script>
hello there<br>
HWG hwg-style mailing list archives,
maintained by Webmasters @ IWA