-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
item loop in _lazyLoadItems caches item length can cause exception #58
Comments
Hi @zspitzer, I'm actually not sure, how this could happen. Inside the Do you have an example where this happens to you? Can you create a fiddle? And if you have such problem, do you already got a workaround? Thank you so far! |
I'm on holidays and thus dad duty at the moment , so i haven't had time to knock out a fiddle. The customer loader was async as it was doing some network calls , I think I encountered this with some content in a dashboard which involves nested instances of lazy loaders, I was previously having issues with the destroy and namespaces which you fixed recently and thought I'd try it out and encountered the exception. but the fix is dead simple |
Ahh well, yes, of course. I was thinking that would work. But on JS it's working this way. 😉 |
fixed as of 1.7.3 |
Because the length of the item array is being cached, it's possible for an exception to be triggered in
_isInLoadableArea
, "element is undefined" if a loader with a callback is used and the size of the item array is reduced by another round of_lazyLoadItems
being executed which removes one or more items from the item array, whilst waiting for the loader to return.https://github.com/eisbehr-/jquery.lazy/blob/master/jquery.lazy.js#L305
The text was updated successfully, but these errors were encountered: