jquery.esn.autobrowse.js

Autobrowse jQuery plugin

This plugin adds automatic ajax loading of page content when the user scrolls the page, with built-in browser cache. More info in this blog post. Simply use autobrowse(options) on a container that you want to fill with content.

Changelog, download and docs: jquery.esn.autobrowse.js.

LICENCE: Do whatever you want with the code. I don't take any responsibility for how you use it.

Example usage:

$(".page .items").autobrowse(
    {
        url: function (offset)
        {
            return "http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?";
        },
        template: function (response)
        {
            var markup='';
            for (var i=0; i<response.items.length; i++)
            {
                markup+='<a href="'+response.items[i].link+'"><img src="'+response.items[i].media.m+'" /></a>'
            };
            return markup;
        },
        itemsReturned: function (response) { return response.items.length; },
        offset: 0,
        max: 100,
        loader: '<div class="loader"></div>',
        useCache: true,
        expiration: 1
    }
);
    

Demo: Scroll down for more cats. Demo using Twitter API (New!)

Note that the demo url does not use offset in the url, so it loads the same data every time.

Clear cache