-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
jQuery 1.6.1 "undefined" errors #40
Comments
can you link to a page where we can reproduce this? thx |
The app using it is internal, so I can't. Sorry. |
can you let us know what line of code this is happening on? |
bueller? |
This bug was appearing under Infinite Scroll 2.0b1.110420 on line 81: var number = $(element).length + $(element).html().length + $(element).attr("class").length + $(element).attr("id").length; It looks like it has since been resolved in the recent 2.0b2.110603 update. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jQuery 1.6.1 is throwing "undefined" errors when the parent element of itemSelector is missing either an ID or class. The following example uses just an ID on the parent element, and throws an "$(element).attr("class") is undefined" error. A similar error is thrown if you use just a class.
This example previously worked fine on jQuery 1.4.4. The error is being caused due to the way jQuery 1.6.x is reporting errors in the .attr() method. "As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set." http://api.jquery.it/attr/
The way to fix the issue (in the user's code) is to ensure the parent element has both an ID and class assigned to it. I figured this was worth reporting, in case a catch can be added into the InfiniteScroll JS code.
JavaScript:
Failing HTML:
Working HTML (the actual values of ID and class are not important, just that they are both present):
Hope this helps.
The text was updated successfully, but these errors were encountered: