
| home | AJAX (9) || C#.NET (7) || Coldfusion Development (16) || DHTML (16) || Flash Development (20) || jQuery (9) || MSSQL (2) || UNIX (11) |
| 1.31.07 | True ColdFusion whitespace removal + CFAJAX support |
To go on my other article, I added two lines to my onRequestEnd function as set in the Application.cfc. These lines will parse out preceding and trailing whitespace for all CFAJAX responses if your CF server is still having trouble doing proper “whitespace management”.
Download this code: onrequestend-whitespace-ajax
The holy grail in coldfusion whitespace management. I added the following lines to remove tabs, carriage returns and line feeds:
|
||
| #341 217chars | ||
The lines got filtered, another try: cfset pageContent = REReplace(pageContent, chr(9), “”, “all” ) |
||
| #342 232chars | ||
it better to replace them with a space and the compress al whitespace to a single space cfset pageContent = Replace(pageContent, chr(9), ” “, “all” ) |
||
| #343 353chars | ||
Its not necessary to remove the tabs chr(9) ’cause [:space:] includes tabs. Only use this when not using pre tags! |
||
| #344 118chars | ||
Jonathan, Using the Chr() function makes more sense than using the [[::]] regex aliases! Thanks for adding that! Also, very good call on NOT using ANY tags with the [[:space:]] seeing as it the tabs are stripped. I honestly never thought of that seeing as I rarely use the tag. I was on a mission to remove characters from being sent to the user seeing as I wrote this at the same time as fixing HTTP compression - so "Less Is Better" was the mindset at the time. Any other characters we should strip? |
||
| #348 522chars |