peol / jquery.imgloaded

Fake fork of Paul Irish's image loaded method for jQuery
48 stars 22 forks source link

"Too much recursion" error FF4 #2

Open WraithKenny opened 14 years ago

WraithKenny commented 14 years ago

When the plugin is run in FF4 this error is reported and the rest of the scripts on the page don't run.

WraithKenny commented 14 years ago

See the comments on api.jquery.com/load-event/ for solution/alternative.

peol commented 14 years ago

I think I got that fixed locally, but I got issues replicating the image caching bugs in IE at the moment, so I'll wait to push it to github before actually verifying everything's working.

foscamf6 commented 13 years ago

I just ran into the recursion problem on FF3.6.10 (mac) too. It's inconsistent - it doesn't happen on every page load, and when it does it's on random elements. Using the workaround in the comments on the jquery api page (see above) until you push the update.

peol commented 13 years ago

Yes, as of now, you should be using either bind-event-before-setting-source approach, or the workaround on the API site. This plugin is right now busted without a clear solution, I'm afraid.

jcljules commented 13 years ago

The problem with this function is that it doesn't just bind to images - it adds this loader to every single element on the page. Change event.special.load to event.special.imgpreload, then bind an imgpreload event to the specific images you'd like to preload. Worked like a charm for me, in all browsers.

chrihala commented 13 years ago

jcljules's advice seems to work in Firefox 3.6 and Chrome 7. Thanks mate!

jefferyto commented 13 years ago

I have an experimental fork of this plugin at https://github.com/jefferyto/jquery.imgloaded/tree/pi . Can you give it a try? I'd like to get some feedback before submitting a pull request. Thanks!