If iframe src is changed dynamically in the page and the page is reloaded, the old src is still used

RESOLVED DUPLICATE of bug 279048

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 279048
9 years ago
9 years ago

People

(Reporter: sissie313, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1
Build Identifier: 

Repro:
Say, I have a page A which dynamically contructs a (always unique) URL U and writes an iframe with src="U" into the DOM of A (using document.write).
Then I reload the page. What happens is that a new URL is constructed, say, U1, but the browser does not request U1 from the server, but instead makes a request for (the old) U. 

Not requesting the "new" U1, but re-requesting the old U does not make any sense.  Also note that this does *not* happen if we use an img request (instead of an iframe), or, if you go to the location bar of the browser and hit enter.

Expected:
That the "new" src U1 gets loaded in the iframe on reload.



Reproducible: Always

Steps to Reproduce:
Say, I have a page A which dynamically contructs a (always unique) URL U and writes an iframe with src="U" into the DOM of A (using document.write).

Then I reload the page. 

Actual Results:  
What happens is that a new URL is constructed, say, U1, but the browser does not request U1 from the server, but instead makes a request for (the old) U. 

Not requesting the "new" U1, but re-requesting the old U does not make any sense.  Also note that this does *not* happen if we use an img request (instead of an iframe), or, if you go to the location bar of the browser and hit enter.



Expected Results:  
That the "new" src U1 gets loaded in the iframe on reload.



E.g., try creating an html page with this following src, then keep reloading the page.  Even though the src has changed before the reload happens the iframe still refers to the old src.

<html>
<body>
<script type="text/javascript">
var r = Math.random();
document.write("<p>" + r + "</p>");

var url = (r > 0.5) ? "http://www.google.com" : "http://www.youtube.com";

if (Math.random() > 0.5) {
  document.write("<p>" + url + "</p>");
  document.write("<iframe src='" + url + "' height=300 width=500 />");
}

</script>

</body>
</html>
Created attachment 346377 [details]
Testcase from the reporter

Reporter: Please always include a used version if you report a bug (that's not only valid for bugzilla.mozilla.org)
wfm with SM trunk
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 279048
You need to log in before you can comment on or make changes to this bug.