I've an example of a technique here:

http://www.depressedpress.com/Content/Development/ColdFusion/Articles/GetRes
/Index.cfm

That code is really old however.

The version I'm actually using is wrapped as a custom tag and determines JS
version (and whether or not it's enabled) as well.  I'll attach the
JavaScript of it below.

Jim Davis


<script language="Javascript" type="text/javascript">var JSVersion =
1.0</script>
<script language="Javascript1.1" type="text/javascript">JSVersion =
1.1</script>
<script language="Javascript1.2" type="text/javascript">JSVersion =
1.2</script>
<script language="Javascript1.3" type="text/javascript">JSVersion =
1.3</script>
<script language="Javascript1.4" type="text/javascript">JSVersion =
1.4</script>
<script language="Javascript1.5" type="text/javascript">JSVersion =
1.5</script>
<script language="Javascript" type="text/javascript"><!--

                // Default all Values to Zero
        ColorDepth = 0;
        ResHeight = 0;
        ResWidth = 0;
        ResAvailHeight = 0;
        ResAvailWidth = 0;
        ResBrowserHeight = 0;
        ResBrowserWidth = 0;
                // Get the basic values 
        if (JSVersion > 1.1) {
                ColorDepth = screen.colorDepth;
                ResHeight = screen.height;
                ResWidth = screen.width;
                ResAvailHeight = screen.availHeight;
                ResAvailWidth = screen.availWidth;
        };
                // Try to get the Browser Window info
                // If the innerwidth property is set then try to use that -
supported by Netscape and several other browsers
        if( typeof( window.innerWidth ) == 'number' ) {
                ResBrowserWidth = window.innerWidth;
                ResBrowserHeight = window.innerHeight;
                // The following is only supported by IE 6 in some cases.
        } else if( ( typeof( document.documentElement.clientWidth ) ==
'number' ) && ( document.documentElement.clientWidth > 0 ) ) {
                ResBrowserWidth = document.documentElement.clientWidth;
                ResBrowserHeight = document.documentElement.clientHeight;
                // Finally test if we're IE and use the IE specific values
        } else if( document.body && ( document.body.clientWidth ||
document.body.clientHeight ) ) {
                ResBrowserWidth = document.body.clientWidth;
                ResBrowserHeight = document.body.clientHeight;
        };
                // Create the call to the image
        document.write("<img src='FauxGIF.cfm?ScreenData=JS" + JSVersion +
"," + ColorDepth + "," + ResHeight + "," + ResWidth + "," + ResAvailHeight +
"," + ResAvailWidth + "," + ResBrowserHeight + "," + ResBrowserWidth + "'
width='1' height='1' alt='' border='0'>");

        //-->
</script>
<noscript><img name="HeartBeat"
src="FauxGIF.cfm?ScreenData=NoJS,0,0,0,0,0,0,0" width="1" height="1" alt=""
border="0"></noscript>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225573
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to