• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF adding extra <html>, <head>, and <body> tags to pages

New Here ,
Apr 15, 2013 Apr 15, 2013

Copy link to clipboard

Copied

I have been having issues with my titles not showing up on my CF pages. I finally looked at the page source in the browser and found that CF is inserting extra <html>, <head> and <body> tags at the beginning of the pages. (see samples below). I'm pretty sure it is the CF engine that is doing this because I took a cfm page and just changed the extension to html and everything worked fine (except the CF code). There weren't any extra tags inserted and the titles was displayed. I also noticed that the CF engine appears to be adding the very first line <!DOCTYPE HTML ...>

Does anyone know why this might be happening?

Thanks

David

CF Page - notice extra tags in red

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


<html>

<head>

<title>Untitled</title>

</head>


<body>



</body>

</html>

<html>

<head>


<style type="text/css">

<!--


BODY
{
font-weight: normal;
font-size: 10pt;
font-family: Arial;
background-color: white;
text-decoration: none
}


Same page with extension changed to html - code is a bit different because style sheet didn't load because it uses cfinclude

<html>

<head>


<cfinclude template="fdp_style_sheet.html">


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

<title>Login</title>


<script type="text/javascript">

if($_SERVER["HTTPS"] != "on")
{
    header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
    exit();
}
</script>


<script language="JavaScript" src="webbug.js"></script>

</head>


<body onload="writeBug();" marginheight="0" marginwidth="0">

Views

548

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Apr 15, 2013 Apr 15, 2013

Take a look at your Application.cfm or Application.cfc file you probably have that code in there (Application.cfc/cfm runs first on every page request)

Votes

Translate

Translate
Enthusiast ,
Apr 15, 2013 Apr 15, 2013

Copy link to clipboard

Copied

Take a look at your Application.cfm or Application.cfc file you probably have that code in there (Application.cfc/cfm runs first on every page request)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2013 Apr 15, 2013

Copy link to clipboard

Copied

LATEST

Peter,

That was it.

Thanks!

DW

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation