[jQuery] ColdFusion, ajax, post, jquery and whitespace
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