Refresh of Page does not clear state of text area

RESOLVED DUPLICATE of bug 46845

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 46845
6 years ago
6 years ago

People

(Reporter: Timothy M. Rodriguez, Unassigned)

Tracking

9 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Build ID: 20111220165912

Steps to reproduce:

I was playing around with some javascript and created a text area "console" to print out the affects of some of my javascript.

<html>
<head><title>Graph JS Test Page</title></head>
<link rel="stylesheet" type="text/css" href="css/graph.css" />
<body onLoad="runTests();">
<h1>This is the Graph JS Test Page</h1>
<textarea id="console">
Console Output:
</textarea>

<script type="text/javascript" src="test.js"></script>
</body>
</html>


I then had a logging function like this:

function log(message) {
	var consoleTextArea = document.getElementById("console");
	consoleTextArea.value += "\n" + message;
	console.log(message);
}


I had code which would output a message to the screen and then refreshed the page with the refresh arrow button.


Actual results:

If I refreshed the page, the last message would remain and new messages would continue to be appended.  Essentially the text area (or the javascript message variable, I'm not sure which), remembered its state from the last page load when pressing the refresh button.  However, the page started from a clean slate correctly if I instead went back into the URL bar and hit enter to reload the page.



Expected results:

I would expect the text area to start with it's default state of "Console Output:" as in the html and then the javascript would re-insert the message.  Instead, every time I refreshed the page the same message would continue to be added.

For example, if I loaded the page and then refreshed it once I would see.

Console Output:
Message to be displayed.
Message to be displayed.

If I refreshed a third time I would see.

Console Output:
Message to be displayed.
Message to be displayed.
Message to be displayed.
(Reporter)

Comment 1

6 years ago
Correction, the last part was if I refreshed it a second time.*

The initial page load was correct and looked like:

Console Output:
Message to be displayed.

Comment 2

6 years ago
AFAIU, this is intentional. Text areas are not cleared unless you do a force reload

Marking as a duplicate of bug 46845
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 46845
You need to log in before you can comment on or make changes to this bug.