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);
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson