Here is snippet of code from my application.cfm to do this:
(locks already applied)
<cfif not isdefined("session.screenres") >
<cfif isdefined("url.width") and isdefined("url.height")>
<cfscript>
session.screenres=structnew();
session.screenres.width=url.width;
session.screenres.height=url.height;
</cfscript>
<cfelse>
<cfoutput>
<script>
loc='#cgi.script_name#';
qs='?#urlencodedformat(cgi.query_string)#';
if (screen.width && screen.height){
qs+="&width=" +screen.width;
qs+="&height=" +screen.height;
}
else{
qs+="&width=800&height=600";
}
location.replace(loc+qs);
//alert(screen.width +" " +screen.height);
</script>
</cfoutput>
<cfabort>
</cfif>
</cfif>
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, July 25, 2001 7:51 AM
Subject: Re: javascript vars to cf vars?
> I've actually found a unique way to do it with our implementation. I just
> started here and the current implementation is very messy (There is not a
> comment in sight. not even a bad one!). What was being attempted was to
> create a form full of hidden input types and then setting the values of
> those variables to the javascript values that I was trying to capture
> (i.e. <form name="getinfo" action="script_test.cfm" method="post">
> <input type="Hidden" name="MyBrowser"> ...
> document.getinfo.MyBrowser.value=navigator.appName;)
> We are using frames and that caused problems. All I did was to create an
> additional frame, set the frame height to 0 and now it works fine. This
way
> it executes within that frame and doesn't try to sneak out like it did
> before.
>
> Michael Corrigan
> Programmer
> Endora Digital Solutions
> www.endoradigital.com
> 630/942-5211 x-134
> ----- Original Message -----
> From: "Shawn Grover" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 24, 2001 5:23 PM
> Subject: RE: javascript vars to cf vars?
>
>
> > why not have one page which uses JS to gather the info you need (screen
> > width, etc.), then submit this to a CF page using forms, or url
> parameters.
> > The CF page would then set cookies or session variables (unfortunately,
I
> > don't think you can set Appliation variables this way).
> >
> > Just my thoughts.
> >
> > Shawn Grover
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 24, 2001 1:27 PM
> > To: CF-Talk
> > Subject: Re: javascript vars to cf vars?
> >
> >
> > I'm trying to do the same thing, but I have a couple of issues that I
> can't
> > get around. The big one is that we use frames and that seems to really
> > screw things up. I want to do it passively every time someone views one
> of
> > our clients pages. I've tried to do it in the application.cfm file, but
> > with the redirects and the frames it messes it up so it doesn't work.
Is
> > there a way to gather the information via CF without using JS?
> >
> > Thanks all,
> >
> > Michael Corrigan
> > Programmer
> > Endora Digital Solutions
> > www.endoradigital.com
> > 630/942-5211 x-134
> > ----- Original Message -----
> > From: "Michael Lugassy" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Monday, July 16, 2001 7:01 PM
> > Subject: javascript vars to cf vars?
> >
> >
> > > this might sound stupid but - is it possible to put js vars (like,
> screen
> > width) into
> > > coldfusion vars?
> > >
> > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
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