Treehouse: Grow your CSS skills. Land your dream job.

Infinite scroll strips out my other scripts

  • # July 16, 2013 at 6:40 pm

    Hello! I’m new here. Anyway, I have this site where I implemented the infinite-scroll plugin by Paul Irish. It works fine and all but the problem is that once I load a new page, all my other jquery plugins stop working.

    I have searched and I found out that the reason the infinite scroll doesn’t work with other jquery plugins, is because it uses the .load method and that jquery itself strips out all script tags. And the author of the plugin wrote that you had to callback the functions and append them by using the function below

    function( newElements ) {

    Now I don’t know any jquery but on one of my plugin, you had to invoke it by calling this code


    so I tried to put it there and now the code looks like this

    At first this didn’t change a thing. So I tried to use chrome’s inspect element and suddenly everything worked. But only until I refreshed the page, once I did that I had to use chrome’s inspect element before everything worked again. And I can’t tell if I am on the right track cause everything works perfectly once I use chrome’s inspect element. Anyone that have used or know about infinite scroll that can put me on the right path?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.