Skip to main content
Inspiring
August 11, 2008
Answered

AJAX problems in CF8

  • August 11, 2008
  • 2 replies
  • 553 views
I'm in the process of migrating an AJAX-heavy application from CF7 to CF8. CF8 is creating an unterminated string literal error on the second and subsequent AJAX call. Same code that runs fine in CF7. The AJAX is just pure javascript, no custom libraries or anything. The XMLHttpRequest.responseText is populated with the expected result.

In looking at the results, I don't see any reason an error should occur. The only variable is CF7/CF8.

Thoughts?
This topic has been closed for replies.
Correct answer rhaddan
I answered my own question... make sure "Suppress Whitespace" is checked in the Coldfusion administrator. Even though I'm stripping out all of the whitespace in my output, CF is still adding some of its own.

2 replies

Inspiring
August 13, 2008
rhaddan wrote:
> I answered my own question... make sure "Suppress Whitespace" is checked in the
> Coldfusion administrator. Even though I'm stripping out all of the whitespace
> in my output, CF is still adding some of its own.
>

As well as the "Suppress Whitespace" option there are the
<cfsilent></cfsilent>, <cfcontent reset="yes"...> and <cfsetting
enableOutputOnly="yes"> tags that can be utilized to control undesired
whitespace generated by CFML code.

There is an entire chapter in the documentation about this topic if you
care to learn more about the options.

rhaddanAuthorCorrect answer
Inspiring
August 13, 2008
I answered my own question... make sure "Suppress Whitespace" is checked in the Coldfusion administrator. Even though I'm stripping out all of the whitespace in my output, CF is still adding some of its own.