Closed
Bug 46038
Opened 24 years ago
Closed 24 years ago
document.write doesn't work in Strict mode
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: jonathanbaron7, Assigned: jst)
References
()
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; m17) Gecko/20000719
BuildID: 20000071920
The following does not display, and the page ends with
"/html>" even though it is valid according to validator.w3.org
<script language="JavaScript" type="text/javascript">
<!--
document.write('<i><font size=1>Last modified: '
+ document.lastModified + '<\/font><\/i>');
//-->
</script>
Reproducible: Always
Steps to Reproduce:
1. go to page
2.
3.
This happens in all the subpages too, that is,
all the major links of www.psych.upenn.edu
This is strict mode only. Marking confirmed. Possibly related to bug 45975,
"document.write in strict dtd crashes browser".
cc: harish
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: does not show document.write addition → document.write doesn't work in Strict mode
Comment 2•24 years ago
|
||
works fine on NT4 with cuild ID :2000072008
Assignee | ||
Comment 3•24 years ago
|
||
The problem is not that document.write() doesn't work in strict mode, the proble
is that the strict DTD doesn't allow script tags any place other than as immediate
children of the head and body tags in the document.
This is a dupe of bug 42388.
*** This bug has been marked as a duplicate of 42388 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Reopening. Bug 42388 is, at this point, only for invalid pages. The HTML on
this page is valid. Making the "written" HTML valid (by putting it in a P)
doesn't help either.
The SCRIPT element is showing up in the content model, but with no content.
Does script content normally show up in the content model?
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
David, I thought the SCRIPT can be contained only in the HEAD or BODY. If that's
true then the page is not a valid HTML.
"The SCRIPT element places a script within a document. This element may appear
any number of times in the HEAD or BODY of an HTML
document."
Comment 6•24 years ago
|
||
'in the body' doesn't mean the same as 'a direct child of the body'.
Since the script's parent, a cell (<td>), is in the body, so is the script.
In the DTD, SCRIPT is contained in the %special group, which means it can appear
anywhere that A and BR can, for example, as well as as a direct child of <body>,
<form>, and <head>, where it is included explicitly.
Thanx. I think this is a dup of bug 46392 [ have a fix in hand ].
*** This bug has been marked as a duplicate of 46392 ***
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•