Skip to main content
Participating Frequently
May 14, 2015
Question

CF9 - Page Generating Blank Code

  • May 14, 2015
  • 1 reply
  • 459 views

Hi,

I have been using coldfusion to generate pages on my server. However I have noticed that coldfusion seems to be generating the code below before the main code of the page. This seems to be affecting code trying to resolve compatibility mode issues in Internet Explorer, etc.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>

<body>

</body>

</html>

Can anyone please advise if they know why this would be happening?

Many thanks!

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
May 14, 2015

ColdFusion is not responsible for sending HTML content to the browser. That is the job of the web server.

In any case, could you show us an example of your code?

Participating Frequently
May 14, 2015

So is this to do with the IIS on our server?

The code is normal coldfusion code:

<cfquery name="queryname" datasource="dsn">

select field_name from table_name

</cfquery>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>...</title>...


However, as mentioned, the empty code above appears before this when I view page source.

BKBK
Community Expert
Community Expert
May 17, 2015

I can't see anything that might include html in the code I'm using.

This occurs on IE, Chrome and Firefox


Another suggestion, more or less a stab in the dark: implement the following method in your Application.cfc

<cffunction name="onRequest">

       <cfargument name = "targetPage" type="String" required=true/>

       <cfsavecontent variable="pageContent">

          <cfinclude template="#arguments.targetPage#">

       </cfsavecontent>

       <cfif findNoCase("table.cfdump_wddx,", pageContent) gt 0>

        The string "table.cfdump_wddx," was found in the page, <cfoutput>#arguments.targetPage#</cfoutput><cfabort>

        </cfif>

    </cffunction>