You will need to have a listener page grab the screen properties via JS,
then send those to a CF page, then go to the index page as if they were
entering the site.

You can also base this on session state - so that if this is the users first
request for a particular session.

EXAMPLE (in you "application.cfm" or index page):

<cfparam name="Session.Init" default=0>

<cfif Session.Init EQ 0>
        ...
        <cfset Session.Init = 1>
        <script language="JavaScript" type="text/javascript">
        document.write('<form action="act/getScreenProp.cfm"
method="post">');
        document.write('<input Type="Hidden"
Name="screen_height" Value="'+ screen.height +'">');
        document.write('<input Type="Hidden"
Name="screen_width" Value="'+ screen.width +'">');
        document.write('<input Type="Hidden"
Name="screen_colors" Value="'+ screen.colorDepth +' Bit">');
        document.write('</form>');
        document.forms[0].submit();
        <script>
        <cfabort>
</cfif>

-- 
SCOTT VAN VLIET 
SENIOR ANALYST 
SBC SERVICES, INC 
Tel: 858.886.3878 
Fax: 858.653.6763 
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 




-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:17 PM
To: CF-Talk
Subject: RE: Screen width, Height, & Color Depth


I need to obtain this info when someone enters the site. 

Thanks,
Jason Larson 
 

-----Original Message-----
From: Sam Roach [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 25, 2002 2:06 PM
To: CF-Talk
Subject: RE: Screen width, Height, & Color Depth

opps forget the first half:

can you use:
                                <script>
                                        document.write('<input
Type="Hidden"
Name="screen_height" Value="'+ screen.height +'">');
                                        document.write('<input
Type="Hidden"
Name="screen_width" Value="'+ screen.width +'">');
                                        document.write('<input
Type="Hidden"
Name="screen_colors" Value="'+ screen.colorDepth +' Bit">');
                                </script>



        #screen_height#
        #screen_width#
        #screen_colors#

-----Original Message-----
From: Sam Roach [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 12:58 PM
To: CF-Talk
Subject: RE: Screen width, Height, & Color Depth


can you use:
        #screen_height#
        #screen_width#
        #screen_colors#


-----Original Message-----
From: BEN MORRIS [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 12:49 PM
To: CF-Talk
Subject: Re: Screen width, Height, & Color Depth


You will have to have one form page that they come to and have JS write
the
values in a hidden form field, then have that submit to an action page,
after which you will have the values to use in CF.  Of course, you can't
capture this in all browsers.

More JS help: http://www.webreference.com/js/column17/dimensions.html

>>> "Jason Larson" <[EMAIL PROTECTED]> 03/25/02 03:35PM >>>
I have very little javascript experience and what I am trying to
accomplish is to use javascript to give me the height, width and color
depth of a user's browser and turn those javascript variables into a CF
variable so I can use them in a cf template. I was wondering if anybody
had any code snippets for something like this, and if so would you mine
sharing.

Thanks in advance,
Jason Larson







______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to