Solved

Mysterious artifact "7" in html body tag innerHTML

Posted on 2012-04-01
3
432 Views
Last Modified: 2012-04-02
Recently I noticed a mysterious "7" appearing in the top left corner of my homepage: http://heart2heartshanghai.net/index.cfm but I cannot find a "7" in my CFML code.
In trying to track this down (to remove it), I created a totally empty new page in my site's root: http://heart2heartshanghai.net/index2.cfm -- but the "7" still mysteriously appears!

Firebug shows the HTML of the "empty" page as:
<html>
<head></head>
<body>7 </body>
</html>

Open in new window

and when I inspect the DOM with Firebug I see several references to "7\n" (which I think is the mysterious artefact I want to remove) which I have highlighted in bold:

baseURI
      "http://heart2heartshanghai.net/index2.cfm"
      
childElementCount
      2
      
childNodes
      [head, body]
      
0
      head
      
accessKey
      ""
      
accessKeyLabel
      "^"
      
contextMenu
      null
      
dataset
      DOMStringMap {}
      
isContentEditable
      false
      
onmouseenter
      null
      
onmouseleave
      null
      
onmozfullscreenerror
      null
      
parentElement
      html
      
accessKey
      ""
      
accessKeyLabel
      "^"
      
contextMenu
      null
      
dataset
      DOMStringMap {}
      
isContentEditable
      false
      
onmouseenter
      null
      
onmouseleave
      null
      
onmozfullscreenerror
      null
      
parentElement
      null
      
click
      click()
      
contains
      contains()
      
insertAdjacentHTML
      insertAdjacentHTML()
      
mozRequestFullScreen
      mozRequestFullScreen()
      
attributes
      []
      
length
      0
      
getNamedItem
      getNamedItem()
      
getNamedItemNS
      getNamedItemNS()
      
item
      item()
      
removeNamedItem
      removeNamedItem()
      
removeNamedItemNS
      removeNamedItemNS()
      
setNamedItem
      setNamedItem()
      
setNamedItemNS
      setNamedItemNS()
      
__proto__
      [xpconnect wrapped native prototype] { item=item(), getNamedItem=getNamedItem(), setNamedItem=setNamedItem(), more...}
      
baseURI
      "http://heart2heartshanghai.net/index2.cfm"
      
childElementCount
      2
      
childNodes
      [head, body]
      
0
      head
      
1
      body
      
accessKey
      ""
      
accessKeyLabel
      "^"
      
contextMenu
      null
      
dataset
      DOMStringMap {}
      
isContentEditable
      false
      
onmouseenter
      null
      
onmouseleave
      null
      
onmozfullscreenerror
      null
      
parentElement
      html
      
click
      click()
      
contains
      contains()
      
insertAdjacentHTML
      insertAdjacentHTML()
      
mozRequestFullScreen
      mozRequestFullScreen()
      
aLink
      ""
      
attributes
      []
      
background
      ""
      
baseURI
      "http://heart2heartshanghai.net/index2.cfm"
      
bgColor
      ""
      
childElementCount
      0
      
childNodes
      [<TextNode textContent="7\n">]
      
0
      <TextNode textContent="7\n">
     
parentElement
      body
      
wholeText
      "7\n"

      
contains
      contains()
      
attributes
      null
      
baseURI
      "http://heart2heartshanghai.net/index2.cfm"
      
childNodes
      []
      
constructor
      Text {}
      
data
      "7\n"

      
firstChild
      null
      
lastChild
      null
      
length
      2
      
localName
      null
      
namespaceURI
      null
      
nextSibling
      null
      
nodeName
      "#text"
      
nodeType
      3
      
nodeValue
      "7\n"


Can anyone tell me what is going on -- how the "7" got there, and how do I remove it?
0
Comment
Question by:ShanghaiD
3 Comments
 
LVL 17

Accepted Solution

by:
selvol earned 500 total points
ID: 37794549
Try adding this to your application.

<cfscript>
SetEncoding("form","utf-8");
SetEncoding("url","utf-8");
</cfscript>
<cfcontent type="text/html; charset=utf-8">

Selvol
0
 
LVL 7

Expert Comment

by:micropc1
ID: 37794590
You might want to take a look at your Application.cfm or Application.cfc (esp the onRequestStart() method)
0
 

Author Closing Comment

by:ShanghaiD
ID: 37794765
Excellent!  Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now