CFLib.org – Common Function Library Project

deleteDoctype()

Last updated July 11, 2005

author

Nathan Strutz

Version: 1 | Requires: CF6 | Library: UtilityLib

Description:
If you're having display issues on a page, call this function to remove the doctype from your request. This solves the display problems with using cfdump in CFMX under an XHTML doctype. You can modify this code to, for example, change a strict doctype to a transitional one.

Return Values:
Returns nothing.

Example:

<cfset deleteDoctype()>

Parameters:

No arguments.

Full UDF Source:

/**
 * Deletes the doctype out of the current page request.
 * 
 * @return Returns nothing. 
 * @author Nathan Strutz (mrnate@hotmail.com) 
 * @version 1, July 11, 2005 
 */
function deleteDoctype() {
    var str = getPageContext().getOut().getString();
    str = reReplace(str,"<!DOCTYPE[^>]*>","","ONE");
    getPageContext().popBody().clearBuffer();
    writeOutput(str);
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson