airbnb / infinity

UITableViews for the web (DEPRECATED)
http://airbnb.io/infinity/
Other
2.8k stars 281 forks source link

Error when I use infinity.js #3

Closed yshuolu closed 11 years ago

yshuolu commented 11 years ago

When I import the infinity.js into my html, and then I write: var $el = $('#my-infinite-container'); . The chrome console raise an error that is "Uncaught TypeError: Object [object Object] has no method 'on' infinity.js:539"

How can I use this js correctly?

reissbaker commented 11 years ago

It's hard to tell without any more detail, but my first intuition is that you're not loading jQuery. Make sure to have at least jQuery 1.7.x (1.8.x should work too) in a script tag before infinity.

yshuolu commented 11 years ago

Here is my code. Thank you so much.

https://www.evernote.com/shard/s111/sh/cbcfebcc-cdfb-4221-8a4d-b6b683e42046/c9fde09a7a47121f283e67d2e59a9fb1

reissbaker commented 11 years ago

You're using jQuery 1.5 -- Infinity needs at least the 1.7 version. Try replacing your old jQuery script tag with this:

<script src=https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script>