Closed Bug 359513 Opened 20 years ago Closed 20 years ago

document.images[n].src does not work as expected when replacing an existing image

Categories

(SeaMonkey :: General, defect)

PowerPC
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: paul.chudleigh, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0 document.images[n].src="newimg.img" should update the existing image with the new image. It does this but then shows a page which is blank except for the text newimg.img. If you then click back you can see the replaced image as it should be. Reproducible: Always Steps to Reproduce: 1. Go to http://www.google.com/ 2. Put this in the address bar (remove single quotes) and hit enter: 'javascript:document.images[0].src="http://www.google.com/logos/halloween06.gif";' 3. Actual Results: A page with the text 'http://www.google.com/logos/halloween06.gif' is displayed Expected Results: The google logo should have been replaced with the halloween logo. Happens on latest firefox and seamonkey
if you use the javascript: protocol, and want to avoid showing the value of the expression, use something like: javascript:void(document.images[0].src="http://www.google.com/logos/halloween06.gif") not a bug.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.