1

I've build a website for a client and as we all know 'it works just fine on my machine' :-) as it does on several machines at my clients location. But they have (so far) 3 pc's on wich some errors occur, like cannot find ElementById. These machines are normal up-to-date windows machines running IE8.

When comparing the html-source of the page on my machine with one of a machine on wich the error occurred I found that there seems to be a s--tload of html injected. Loads of DIVS and SPAN around attributes and elementID's and even javascript :

Normal:

<script type="text/javascript" language="JavaScript">

After injection:

script will be surrounded with a SPAN tag using class 'HTML_ELM'
type will be surrounded with a SPAN tag using class 'HTML_ATR'
"text/javascript" will be surrounded with a SPAN tag using class 'HTML_VAL'

<<span class="HTML_ELM">script</span> <span class="HTML_ATR">type</span>=<span class="HTML_VAL">"text/javascript"</span> <span class="HTML_ATR">language</span>=<span class="HTML_VAL">"JavaScript"</span>>

even ID's of html elements are surrounded with these SPAN tags (class='JS_STR') probably causing the problem of cannot find ElementById

I have no idea why this is happening, I also cannot find a cause on Google when searching for these weird classnames used by the injected SPAN/HTML tags (HTML_VAL, HTML_ELM, HTML_VAL).

Does anyone here know what could be causing this ?

many thanks, Jurjen.

4

5 回答 5

1

Well, since you are running IE8, are some of the machines in compatibility mode?

于 2009-11-04T13:39:40.480 回答
1

This extra code comes from the IE8 source viewer. In IE8, if you view source and go to the File menu there are two options under Save, HTML Source and Formatted HTML View. The Formatted HTML View contains all the extra code you are seeing.

于 2010-10-22T16:00:55.327 回答
1

Do your HTML files start with a valid DTD ? like:

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

于 2011-05-02T23:02:03.200 回答
0

Try running it through html-tidy.

An online tidier can be found at http://infohound.net/tidy/.

Then, it'll be easier to track down the problem. It sounds like malformed html.

于 2009-11-04T12:10:51.890 回答
0

Googling span class=HTML_ELM returns lots of results but they've got nothing much in common.

You don't have a syntax highlighter script (or something similar) running on the site by any chance?

于 2009-11-04T13:30:58.773 回答