Closed Bug 463158 Opened 17 years ago Closed 17 years ago

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

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 279048

People

(Reporter: sissie313, Unassigned)

Details

Attachments

(1 file)

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>
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
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: