Bug Tracker

Opened 13 years ago

Closed 13 years ago

#5466 closed bug (worksforme)

Image load only fires once in chrome

Reported by: zaius Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:


Hi there,

I am loading a image in the background, and only displaying it once it has finished loading. For this, I'm using the jquery.load method. When I specify an image url more than once, the load event only fires the first time in chrome, but it fires every time in firefox and safari.

Here's an example: http://pastie.org/687480

Try it here: http://david.kelso.id.au/jqload.html

I'm using jQuery 1.3.2 from google CDN, on Mac 10.6.1, safari 4.0.3, firefox 3.5.4, chrome

First jQuery bug report, so let me know if there's any more info needed.

Thanks! David

Change History (1)

comment:1 Changed 13 years ago by dmethvin

Resolution: worksforme
Status: newclosed

There are a couple of strange things there. First is that the element is never attached to the document; I am not sure all browsers support events on detached elements. Second is that you attach the load event *after* creating the element; it's possible that the event fires (for example on a cached image the second time) before it gets to attach the event.

That said, your example consistently worked for me in IE8, Firefox 3.5, and Chrome Since Chrome 4.0 is a beta, you might want to reproduce the problem just using bare DOM events (if possible) and report it there as a Chrome bug.

Note: See TracTickets for help on using tickets.