CFLib.org – Common Function Library Project

deleteDoctype()

Last updated July 11, 2005

Version: 1 | Requires: ColdFusion MX | Library: UtilityLib

 
Rated 0 time(s). Average Rating: 0

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:

view plain print about
<cfset deleteDoctype()>

Parameters:

No arguments.

Full UDF Source:

view plain print about
<cfscript>
/**
 * 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);
}
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Dave Anderson Dave Anderson added
iniToStruct
20 day(s) ago

Dave Anderson Dave Anderson added
deDupeArray
20 day(s) ago

Richard Richard added
dice
22 day(s) ago

Isaac Dealey Isaac Dealey added
getRelative
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 22 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Raymond Camden highlightAndCrop
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson