Bug Tracker

Modify

Ticket #5466 (closed bug: worksforme)

Opened 4 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

Description

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 4.0.237.0

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

Thanks! David

Change History

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

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 3.0.195.32. 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.