Skip to content
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

nav.size is not a function #26

Open
adrazek opened this issue Jun 21, 2016 · 7 comments
Open

nav.size is not a function #26

adrazek opened this issue Jun 21, 2016 · 7 comments

Comments

@adrazek
Copy link

adrazek commented Jun 21, 2016

Hi,

I got this error on using your library.
Note that The .size() method is deprecated as of jQuery 1.8. Use the .length property instead.

Please use length instead of size().

Regards,

@db0sch
Copy link

db0sch commented Aug 31, 2016

Hi all,
I must say I have the same issue regarding nav.size() is not a function.
Would you update the gem ?
Or shall I make a pull request ?
Thx

@db0sch
Copy link

db0sch commented Aug 31, 2016

@adrazek :
ok, I think I found the glitch.
The problem is not the .size().
It's because nav is undefined. Cause $container is undefined...

Anyway, you must declare the context in your .infinitePages config, with something like : context: '.divClass',

This line goes where you wrote debug: true, buffer:200, loading: ...

If you do it, the browser js console won't raise an error anymore. At least, not on nav.size().

I don't know why the context don't take its default setting though.

@namiwang
Copy link

jquery.size is deprecated in later jquery version, use .length instead.

@clemensg
Copy link

clemensg commented May 6, 2017

Replacing if nav.size() == 0 with if nav.length == 0 worked for me.

@truongnmt
Copy link

Get same error when integrate with Rails app, solution is setup using the Non-Rails ways and fix the library file as @clemensg:

Replacing if nav.size() == 0 with if nav.length == 0 worked for me.

@jdugarte
Copy link

There is a PR with this fix waiting for further review: #27

@leoplct
Copy link

leoplct commented Nov 1, 2019

+1 What it should be the context class if I have this structure?

<div class="infinite-table">
	<div class="item_groups">
		<%= render :partial => '/item_groups/item_groups', :object => @item_groups %>  
	</div>
					
	<p class="pagination">
	 <%= link_to_next_page(@item_groups, 'Next Page', :remote => true, theme: 'bootstrap4') %> </p>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants