But you cannot get these values ntil after he page loads as they come from
the dom, so using ajax is perfectly valid way to send dom data back to cf

Regards
Russ Michaels
www.michaels.me.uk
www.cfmldeveloper.com - Free CFML hosting for developers
www.cfsearch.com - CF search engine
On Dec 24, 2012 4:05 AM, <> wrote:

>
>  >>It seems there's no way to avoid the 2nd step either redirect or form
> post.
>
> The problem is not with using POST or GET, the problem is using Ajax.
> Ajax is good for many things, but not for this one.
> Just as you first attempt did, the Ajax call will be performed from client
> side, AFTER the templated is executed and the page read by the browser.
> You cannot do it without executing two steps, but wit redirection, the
> first step to get the values from the client is invisible for the user.
>
> Try my code, there are two steps, but you only see one.
> You can make a POST version of the same idea if
> 1. you do not like the idea of having parameters visible in the url,
> 2. you have other parameters to pass to the template.
>
> Try this code, same idea using a form for redirection:
> <CFIF NOT isDefined("session.screenWidth")>
>    <CFIF NOT isDefined("form.screenWidth")>
>      <FORM NAME="redirectForm" METHOD="POST">
>      <INPUT TYPE="hidden" NAME="screenWidth" VALUE="">
>      <INPUT TYPE="hidden" NAME="screenHeight" VALUE="">
>      <!--- Add any other values here --->
>      </FORM>
>      <SCRIPT>
>        document.redirectForm.screenWidth.value = screen.width;
>        document.redirectForm.screenHeight.value = screen.height;
>        document.redirectForm.action = window.location.href;
>        document.redirectForm.submit();
>      </SCRIPT>
>    <CFELSE>
>      <CFSET session.screenWidth = form.screenWidth>
>      <CFSET session.screenheight = form.screenHeight>
>    </CFIF>
> </CFIF>
>
> <!--- perform the true task of the template here --->
> <CFDUMP var="#session#">
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353666
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to