Skip to main content
January 21, 2009
Answered

Remove unwanted white spaces

  • January 21, 2009
  • 1 reply
  • 575 views
I dont want my code to look ugly, but there are alot of unwanted white spaces being generated from the breaks in my code that make my page look really ugly when select all is on. If I compress all my code together, I will never be able to find anything and it will take forever! What can I do about this?
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    ColdFusion provides several tools to control white space generation.

    In an individual page you can use:

    <cfsilent>
    <!-- nothing in here goes to the client, and I mean nothing -->
    </cfsilent>

    <cfprocessingdirective suppressWhiteSpace = "true">
    <!-- code here is have extra white space consilidated -->
    </cfpocessingdirective>

    <cfsetting enableCFOutputOnly = "true">
    <!-- code on this page will only go to the client if it is inside a
    <cfoutput>...</cfoutput> block. -->

    In the CF administrator you can enable the "Whitespace Management"
    option that will strip out a good deal of extra whitespace.

    Also in your ColdFusion Component <cfcomponent...> and Function
    <cffunction> tags you can set the output="false" parameter so that
    nothing generated inside them is delivered to the client.

    1 reply

    Newsgroup_UserCorrect answer
    Inspiring
    January 21, 2009
    ColdFusion provides several tools to control white space generation.

    In an individual page you can use:

    <cfsilent>
    <!-- nothing in here goes to the client, and I mean nothing -->
    </cfsilent>

    <cfprocessingdirective suppressWhiteSpace = "true">
    <!-- code here is have extra white space consilidated -->
    </cfpocessingdirective>

    <cfsetting enableCFOutputOnly = "true">
    <!-- code on this page will only go to the client if it is inside a
    <cfoutput>...</cfoutput> block. -->

    In the CF administrator you can enable the "Whitespace Management"
    option that will strip out a good deal of extra whitespace.

    Also in your ColdFusion Component <cfcomponent...> and Function
    <cffunction> tags you can set the output="false" parameter so that
    nothing generated inside them is delivered to the client.