javascript document.write to current page gets lost

RESOLVED INVALID

Status

()

Core
DOM: Core & HTML
--
major
RESOLVED INVALID
15 years ago
14 years ago

People

(Reporter: wayne mathias, Unassigned)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
not handling javascript document.write to current page

easiest to see with this webpage   (example.html)

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

<html>
<head>
	<title>example1</title>
    <script>
    function winder(){
    this.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"><html><head><title>ex1p2</title></head><body><div
align="center"><h1><a href="example.html">Go Back</a></h1></div></body></html>')
    }
    </script>
</head>

<body>
<div align="center">
<h1><a href="" onClick="winder()">open javascript page</a></h1>
</div>
</body>
</html>


First noticed the problem with N7 and upon installing and checking found it in
M1.1 also.
(Reporter)

Comment 1

15 years ago
Created attachment 103691 [details]
simple example of bug
to DOM0, this happens on Linux too.
Assignee: rogerl → jst
Severity: normal → major
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
OS: Windows ME → All
QA Contact: pschwartau → desale
Hardware: PC → All
Summary: javascript document.write to current page gets lost → javascript document.write to current page gets lost

Comment 3

15 years ago
I think this is invalid.
What you can see in this case is doing winder() and <a href=""> also.
You should use <a href="" onClick="winder();return false;">.
# And it's better to do document.open(), write(), close().
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs

Comment 5

14 years ago
Everything HARUNAGA said is correct.
By clicking the <- Back button, one can see the order of instruction execution
(page creation and then page loading href value).

Resolving as INVALID
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Keywords: testcase
Resolution: --- → INVALID
(Reporter)

Comment 6

14 years ago
Wow! This is so old I had forgotten about it.
Everything HARUNAGA said a year and a half ago was indeed correct and simply
didn't matter in the older browsers (but DOES matter in the newer ones, with the
return true or false being a valuable tool).
You need to log in before you can comment on or make changes to this bug.