- Partial HTML comments in JavaScript cause problems



Tech Evangelism Graveyard
English US
15 years ago
2 years ago


(Reporter: Robert Myers, Unassigned)





(1 attachment)



15 years ago
If a JavaScript contains the equivalent of a document.write("<!--"), the rest of
the page is messed up until the page contains --> in a script tag or in HTML text

This is an issue because Site Meter ( has code that
does this. 

The HTML tag <script type="text/javascript" language="JavaScript1.2"
src=""> pulls the
javascript that exhibits the issue.

This was an issue in 0.9.7-0.9.9 Windows as well. Dialogue with site meter did
not get the issue resolved on their end.

Comment 1

15 years ago
Browser, not engine ---> Layout

Robert, do we have to login to the site to see how it gets messed up?
When I simply load the site in Mozilla, it looks OK. What exactly are
the steps to reproduce this?

Better yet, would it be possible for you to write a small HTML testcase
and attach it to this bug via the "Create a New Attachment" link above?
I know it should start out with something like


but I'm not sure how it should continue after that - thanks.
Assignee: rogerl → attinasi
Component: JavaScript Engine → Layout
QA Contact: pschwartau → petersen

Comment 2

15 years ago
Is there another script that writes out a "-->" somewhere?  The script is
starting a comment and never finishing it, so I'd expect all content from there
to the next "-->" to be commented out; anything else would be incorrect....

Comment 3

15 years ago
Created attachment 83713 [details]
Reproduction of (perceived) bug caused by Site Meter code

The javascript depends on standard undefined behavior (inclusion of -- in HTML
comments). Feel free to ignore this bug and/or educate Site Meter.This could be
a wide spread issue, since Site Meter is fairly popular.

Comment 4

15 years ago
Ah, ok.  This is only a problem because the page is in standards mode...

So over to evangelism to get Site Meter fixed.
Assignee: attinasi → doron
Component: Layout → US General
Ever confirmed: true
OS: Linux → All
Product: Browser → Tech Evangelism
QA Contact: petersen → zach
Hardware: PC → All
Version: other → unspecified
Summary: Partial HTML comments in JavaScript cause problems → - Partial HTML comments in JavaScript cause problems

Comment 5

14 years ago
Here is contact info:
tech evang june 2003 reorg
Assignee: doron → english-us
QA Contact: zach → english-us

Comment 7

4 years ago
The site does not use this script anymore.
Last Resolved: 3 years ago
Resolution: --- → INVALID
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.