Closed Bug 299752 Opened 19 years ago Closed 19 years ago

JavaScript between body elements is not saved correctly with "Save Page As"

Categories

(Toolkit :: Downloads API, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 115328

People

(Reporter: mansheier, Unassigned)

References

()

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.11  [en]
Build Identifier: Firefox/1.0.4

I use javascript between <body>-Tags. This works fine if the page is displayed. 
But if I use "Save Page As" the output of "document.write('ouput')" is also 
saved as a string in the Webpage. Example-code follows.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 transitional//EN">
<html>
<head>
<title>Save This JavaScript File</title>
</head>

<body>

<script language="javaScript" type="text/javascript"><!--
document.write('<a href="#">this line appears duplicate if you save this with 
Firefox</a><br>');
//--></script>

Please save this file without the document.write(); output.

</body>
</html>

Reproducible: Always

Steps to Reproduce:
1. Use the example-code above or write <script>document.write('bla');... between 
the <body>-tags.
2. Save the page with "Save Page As"
3. Look into the saved file or view the file. "bla" will be displayed twice.
Actual Results:  
The scripted part of the page appears twice. The result looks like the following 
lines for the example-code above:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 transitional//EN">
<html><head><title>Save This JavaScript File</title></head>

<body>

<script language="javaScript" type="text/javascript"><!--
document.write('<a href="#">this line appears duplicate if you save this with 
Firefox</a><br>');
//--></script><a href="#">this line appears duplicate if you save this with 
Firefox</a><br>

Please save this file without the document.write(); output.

</body></html>

Expected Results:  
Leave the scripted parts away. Don't re-format the original webpage when saving, 
just change the links in the webpage.

This problem seems to exist for earlier Mozilla-versions too.
Sound like bug 115328, not?
I do not see this issue with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8b2) Gecko/20050705 Firefox/1.0+ ID:2005070506
I can see the issue with current trunk build.
(In reply to comment #1)
> Sound like bug 115328, not?

Yes, it seems to be the same issue (but from a more technical point of view).

*** This bug has been marked as a duplicate of 115328 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.