Closed Bug 23020 Opened 26 years ago Closed 26 years ago

src property of javascript image object not setting properly

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Windows 98
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: rwillcox, Assigned: vidur)

References

()

Details

(Whiteboard: [HAVE FIX])

Changing the src property of an image object in the document images array replaces the target image with the literal text string from the argument passed as the new source.
Component: Javascript Engine → DOM Level 0
After additional testing, I've determined that the above bug is due to the Mozilla js engine's inability to resolve relative paths for dynamically assigned image sources when the images in question are within a servlet driven document. Below is the exact image rollover code used in the above example URL (it works fine when not in a servlet driven document): function swapImg() { if(!document.images) return; var args = swapImg.arguments; for(i=0; i < args.length; i+=2){ document.images[args[i]].src = args[(i + 1)]; } }
Assignee: mccabe → vidur
Reassiging to DOM owner.
Status: NEW → ASSIGNED
Whiteboard: [HAVE FIX]
Target Milestone: M13
The problem is that the src setting is being done with a relative URL and we aren't taking into account the BASE tag when resolving the URL. I have a fix waiting in my tree.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed on 1/14/2000.
You need to log in before you can comment on or make changes to this bug.