Handling AJAX Errors With jQuery

<!--- Create the response. --->
<cfset objResponse = {
	Success = true,
	Data = "Good request",
	Errors = []
	} />
 
<!--- Serialize the response. --->
<cfset strJSON = SerializeJSON( objResponse ) />
 
<!--- Get the binary response. --->
<cfset binJSON = ToBinary( ToBase64( strJSON ) ) />
 
<!--- Stream it back. --->
<cfheader
	name="content-length"
	value="#ArrayLen( binJSON )#"
	/>
 
<cfcontent
	type="text/json"
	variable="#binJSON#"
	/>

For Cut-and-Paste