Yes Rey. I'm using cfsavecontent with another application and "resolves".
But looks like a step ahead...

Returning to cfsavecontent......

Thanx.

2007/5/25, Rey Bango <[EMAIL PROTECTED]>:


Because CF is horrible at handling whitespace. Always has been.

I always use a CFSAVECONTENT tag to save the output to a var and then I
trim the var before it goes back to the XHR request. So try this:

<cfsetting showdebugoutput="no">

<cfprocessingdirective suppresswhitespace = "yes"
pageencoding="ISO-8859-1">
<cfheader charset="iso-8859-1" name="Expires"
value="#GetHttpTimeString(Now())#">
<cfcontent reset="true" type="text/plain;charset=ISO-8859-1">

<cfsavecontent variable="myResults">
<cfset rndTest = RandRange(90,99)>
<cfif rndTest MOD 2>
     <cfoutput>#rndTest#</cfoutput>
<cfelse>
     no
</cfif>
</cfsavecontent>

</cfprocessingdirective>

<cfoutput>#trim( myResults )#</cfoutput>

Rey

Web Specialist wrote:
> I'll need to test an ajax post to validate if an account already exists
> in database. I'm using this code in action page:
>
> <cfsetting showdebugoutput="no">
> <cfprocessingdirective suppresswhitespace = "yes"
> pageencoding="ISO-8859-1">
> <cfheader charset="iso-8859-1" name="Expires"
> value="#GetHttpTimeString(Now())#">
> <cfcontent reset="true" type="text/plain;charset=ISO-8859-1">
> <cfset rndTest = RandRange(90,99)>
> <cfif rndTest MOD 2>
>     <cfoutput>#rndTest#</cfoutput>
> <cfelse>              <<<<<<<<<< LOOK HERE WITHOUT CFOUTPUT
>     no
> </cfif>
> </cfcontent>
> </cfprocessingdirective>
>
> Using that script returns(randomly) the "no" with 5 chars(maybe because
> <tab> for tags alignment). Including "no" inside <cfoutput returns 3.
> Why CF doesn't works properly removing whitespace?
>
> This is the jquery script:
>
>                     $.ajax({
>                         type: "post",
>                         url: "validateAccount.cfm",
>                         dataType: "html",
>                         data: inputs,
> ............
>
>
> Cheers

--
BrightLight Development, LLC.
954-775-1111 (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com

Reply via email to