Closed Bug 67954 Opened 24 years ago Closed 24 years ago

JavaScript for changing an image doesn't function

Categories

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

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 22820

People

(Reporter: a.bihlmeier, Assigned: pavlov)

Details

(Keywords: dom1)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) BuildID: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; Preview) Gecko/20001103 Beonex/0.6-pre [Beonex] I'm developing for a big Website-project and I want to change an image with an "onError"-event, cause thei image isn't stored. For that case, I want to show a default image. My code is working in IE and Netscape 4.*, but not in Netscape 6/Beonex and so on. I write my script down below, so that you can see, what I mean. The crazy thing is, when I give out "alert's" for showing the right path befor and afterwards the change, I can see the image for a short time on my site, but when I say "ok" to the alert, the image is gone. In the "window.Timeout"-command I tried to show me the path of the image.src again - it's the right path to the dummy-image. Well I do not know what's going wrong there, but it would be very kind of you, when you could help me. Reproducible: Always Steps to Reproduce: 1.just put the script into any site and take two pictures of your own. 2. 3. <div id="table_righttop" class="righttop"> <script language="JavaScript"> <!-- var ueb1 var alternate1 function change(ueb){ ueb1 = ueb; //alert(ueb); alert("here I am: " + ueb.src); alternate = new Image(); alternate.src ="/images/user/user_dummy.gif"; ueb.src= alternate.src; alternate1 = alternate; alert("here I am: " + ueb.src); window.setTimeout("alert(ueb1.src); ueb1.src= alternate1.src;", 2000); } //--> </script> <img name="userimage" src="/images/user/§NCHOST_NICK§.gif" onError="change(this); return false;" width="101" height="121" border=0 alt=""> </div>
dom1, not engine
Assignee: rogerl → jst
Component: Javascript Engine → DOM Level 1
QA Contact: pschwartau → janc
Possibly related? bug 63496 bug 32269 bug 65921
Summary: javascriptfor changing an image does'nt function → JavaScript for changing an image doesn't function
Reporter you might use the dom method setAttribute("src",imageRef) as a work around. The rest is, the same never ending story, traced down to bug 20110. Btw, this is an cache error, set both cache settings (memory/disk) both to 0 and then you will have no problems with the rollovers. When the new necko cache has landed, I suspect all this is history!
Given how much Pavlov loves getting bugs from me I've decided to give him this one too :-), he's working on the new image/cache code.
Assignee: jst → pavlov
Keywords: dom1
there, I found it. Unfortunately this is nowhere close to be fixed :( Patches welcome ;-) *** This bug has been marked as a duplicate of 22820 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
QA contact Update
QA Contact: janc → desale
verified duplicate. Good catch, Fabian.
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.