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

RESOLVED INVALID

Status

SeaMonkey
General
--
major
RESOLVED INVALID
11 years ago
11 years ago

People

(Reporter: Paul Chudleigh, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

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