title: Display json data with simplePagination.js?
body: <p><strong><a href="https://codepen.io/syedazam/pen/xrvwVN" rel="nofollow noreferrer">PAGINATION DEMO</a></strong> </p>
  
  <p>I am developing a pagination with handlebars.js &amp; simplePagination.js</p>
  
  <ol>
  <li><p>Data is loaded from JSON and displayed using handlebars.js</p></li>
  <li><p>Now I have to Map <strong>JSON DATA TO PAGINATION</strong>, where do I do it? Apart from this there is not Much Documentation in the official website "<a href="http://flaviusmatis.github.io/simplePagination.js" rel="nofollow noreferrer">http://flaviusmatis.github.io/simplePagination.js</a>"</p></li>
  </ol>
  
  <p>Request your kind help. Any advice / suggestions are greatly appreciated. </p>
  
  <p>JS CODE : </p>
  
  <pre><code>$(function () {
      function loadPosts(posts) {
          $('#posts').empty();
          posts.each(function () {
              var source = $("#post-template").html();
              var template = Handlebars.compile(source);
               var context = {
              author: this.data.author, 
              domain: this.data.domain,
              id: this.data.id,
              ups: this.data.ups,
              downs: this.data.downs,
              num_comments: this.data.num_comments,
              subreddit: this.data.subreddit,
              title: this.data.title,
              url: this.data.url,
              permalink: this.data.permalink,
          };
              var html = template(context);
              $('#posts').append(html);
          });
      }
      $.ajax({
          dataType: 'json',
          url: "https://www.reddit.com/.json",
          success: function (response_json) {
             // data = $(response_json.records.page);
            data = $(response_json.data.children);
              dataCount = data.length;
              //console.log(data);
              /* if (dataCount &gt; opts.pageMax) {
                   paginate(pageCount);
                   posts = data.slice(0, opts.pageMax);
                   console.log(posts)
               } else {
                   posts = data;
               }*/
              //loadPosts(posts);
              loadPosts(data);
  
              $('.pagination').pagination({
                  items: dataCount, // json length count
                  itemsOnPage: 4
              });
              $('.pagination').pagination('selectPage', 1);
              //$('.pagination').pagination('prevPage', dataCount);
              //$('.pagination').pagination('nextPage', dataCount);
              //$('.pagination').pagination('getPagesCount', dataCount);
              //$('.pagination').pagination('getCurrentPage', dataCount);
              $('.pagination').pagination('updateItems', dataCount);
  
  
          }
      });
  
  });
  </code></pre>