├── .gitignore
├── pagination.min.js
├── README.md
├── test
├── index.html
├── example-1.html
├── example-2.html
├── example-3.html
├── example.process.php
└── data.json
└── pagination.js
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | index.php
3 |
--------------------------------------------------------------------------------
/pagination.min.js:
--------------------------------------------------------------------------------
1 | !function($){"use strict";var bsVersion=3;void 0!==$.fn.tooltip&&(bsVersion=$.fn.tooltip.Constructor.VERSION.split(".")[0]);var rpmListClass="page-num",rpmAnchorClass="",rpmHideClass="hide";function refreshPageforItems(obj,current,limit,url,form){let offset=0,ap;if(obj.parent().hasClass("prev"))offset=limit*(current-2);else if(obj.parent().hasClass("next"))offset=limit*current;else{let cl=obj.data("page_no");offset=limit*((current=parseInt(cl))-1)}null===form||""===form||$(form).length<=0?(ap="?",url.includes("?")&&(ap="&"),window.location.href=url+ap+"limit="+limit+"&offset="+offset):form=$(form),form.append($(" ").attr("type","hidden").attr("name","limit").attr("value",limit)),form.append($(" ").attr("type","hidden").attr("name","offset").attr("value",offset)).submit()}$.fn.rpmPagination=function(options){var settings=$.extend({limit:10,total:0,currentPage:1,domElement:".p-item",refresh:!1,link:null,formElement:null},options);let $this=$(this),pages=1,rpmPageNext=settings.limit,rpmPageTotal=settings.total,tBool=!1,rpmPageDomElem=settings.domElement,rpmCustomDomElem="p-"+Math.random().toString(36).substr(2,6),version;return 4==bsVersion[0]&&(rpmListClass="page-item "+rpmListClass,rpmHideClass="d-none",rpmAnchorClass="page-link"),rpmPageTotal<=0&&(tBool=!0),$(rpmPageDomElem).each((function(i,obj){tBool&&(rpmPageTotal=i+1),$(obj).addClass(rpmCustomDomElem),$(obj).addClass(rpmCustomDomElem+"-"+parseInt(i+1))})),rpmPageTotal>settings.limit&&(pages=parseInt(rpmPageTotal/settings.limit),rpmPageTotal%settings.limit>0&&(pages+=1)),preparePageMenus(settings.currentPage,pages,$this),[settings.currentPage,rpmPageNext]=preparePageItems(settings.currentPage,rpmPageNext,settings.limit,rpmCustomDomElem,"page-num"),settings.refresh&&$("."+rpmCustomDomElem).length>0&&$("."+rpmCustomDomElem).removeClass(rpmHideClass),$(document).on("click",".page-num > a",(function(e){if(e.preventDefault(),$(this).parent().hasClass("disabled")||0===$(this).parent($this).length)return!1;if(!0===settings.refresh)refreshPageforItems($(this),settings.currentPage,settings.limit,settings.link,settings.formElement);else if($(this).parent().hasClass("prev"))[settings.currentPage,rpmPageNext]=preparePageItems(settings.currentPage,rpmPageNext,settings.limit,rpmCustomDomElem,"prev");else if($(this).parent().hasClass("next"))[settings.currentPage,rpmPageNext]=preparePageItems(settings.currentPage,rpmPageNext,settings.limit,rpmCustomDomElem,"next");else{let cl=$(this).data("page_no");settings.currentPage=parseInt(cl),[settings.currentPage,rpmPageNext]=preparePageItems(settings.currentPage,rpmPageNext,settings.limit,rpmCustomDomElem,"page-num")}preparePageMenus(settings.currentPage,pages,$this)})),!0};var preparePageItems=function(current_page,next,limit,element,type){$("."+element).addClass(rpmHideClass);var current=0;if("prev"===type){for(let i=current=(next-=limit)-limit+1;i<=next;i++)$("."+element+"-"+i).removeClass(rpmHideClass);current_page--}else if("next"===type){current=next+1,next+=limit;for(let i=current;i<=next;i++)$("."+element+"-"+i).removeClass(rpmHideClass);current_page++}else if("page-num"===type){next=limit*(current_page-1)+limit;for(let i=current=limit*(current_page-1)+1;i<=next;i++)$("."+element+"-"+i).removeClass(rpmHideClass)}return[current_page,next]},preparePageMenus=function(current_page,pages,element){$(element).html("");let pageArray=[],fp=1,lp=pages,menuHtml="";if(lp<=6)for(let i=1;i<=lp;i++)pageArray.push(i);else pageArray=Math.abs(current_page-1)<3?[1,2,3,4,"...",lp]:Math.abs(current_page-lp)<3?[1,"...",lp-3,lp-2,lp-1,lp]:[1,"...",current_page-1,current_page,current_page+1,"...",lp];menuHtml='
prev ';for(let i=0;i... ':menuHtml+=''+pageArray[i]+" ";return menuHtml+='next ',$(element).append(menuHtml),!0}}(jQuery);
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple Pagination Plugin in jQuery / Bootstrap [ V2.1.1 ]
2 |
3 | ## Getting Started
4 |
5 | In various front-end application developers intend to paginate tabular data / data list in their own custom way.
6 |
7 | * sometimes, without page refresh for fast user interactivity
8 | * sometimes, in a regular pagination with page refresh by sending limit/offset query strings
9 | * sometimes, with searchable form parameters
10 |
11 | For such circumstances, my pagination plugin can be used easily. [see demo](https://projects.sabbirrupom.com/rpm-pagination/)
12 |
13 | ### Prerequisites
14 |
15 | Before you begin, you need following things to be loaded beforehand:
16 |
17 | * jQuery 2+ [ tested upto 3.4.1+ ]
18 | * Bootstrap CSS 3+ [ tested upto 4.3.1+ ]
19 |
20 | ## Usage
21 |
22 | Include the (minified) JavaScript Templates script in your HTML markup:
23 |
24 | ```html
25 |
26 | ```
27 |
28 | Then initialize the plugin function with you pagination item as below:
29 |
30 | ```js
31 | $('[ pagination-menu-holder ]').rpmPagination({ domElement: '[ pagination-item ]' });
32 | ```
33 |
34 | Here,
35 | * [ pagination-menu-holder ] => any suitable html tag [ e.g `` ] or id [ e.g `#custom_pagination` ] or class [ e.g `.custom-pagimation` ]
36 | * [ pagination-item ] => Pagination item elements which are to be viewed in pagination
37 |
38 | ## Options
39 |
40 | Option parameters are as follows:
41 |
42 | ### domElement
43 |
44 | - Type: `string`
45 | - Optional: No, if refresh flag is disabled
46 |
47 | Common class element for all tabular data items. The items of the active pagination number will be shown, other class elements will be kept hidden
48 | [see demo](https://projects.sabbirrupom.com/rpm-pagination/test/example-1.html
49 |
50 | ### limit
51 |
52 | - Type: `integer`
53 | - Optional: Yes
54 | - Default: 10
55 |
56 | Pagination items limit which are to be displayed in each pagination
57 |
58 | ### currentPage
59 |
60 | - Type: `integer`
61 | - Optional: Yes
62 | - Default: 1
63 |
64 | If provided, corresponding pagination menu link will be set to active
65 |
66 | ### total
67 |
68 | - Type: `integer`
69 | - Optional: Yes
70 | - Default: total `domElement` are counted, if refresh flag is disabled
71 |
72 | Total number of page items for pagination
73 |
74 | ### refresh
75 |
76 | - Type: `boolean`
77 | - Optional: Yes
78 | - Default: false
79 |
80 | Refresh flag enables page refresh with limit/offset parameters to pass alongside [ GET / POST ]
81 |
82 | ### link
83 |
84 | - Type: `string`
85 | - Optional: No, if `refresh` flag is enabled and search `formElement` is not set. optional otherwise
86 |
87 | Page refresh link where server will fetch data according to limit and offset parameter which is sent as get query string
88 | [see demo](https://projects.sabbirrupom.com/rpm-pagination/test/example-2.html)
89 |
90 | ### formElement
91 |
92 | - Type: `string`
93 | - Optional: Yes
94 |
95 | User can set this parameter with pagination configuration to point out the custom item search filter form (if exists)
96 | if configured with valid form identifier element, search form will be submitted to form action url along with limit / offset parameter from
97 | pagination menu link.
98 | [see demo](https://projects.sabbirrupom.com/rpm-pagination/test/example-3.html)
99 |
100 | ## Sample Template
101 |
102 | ```html
103 | content 1
104 | content 2
105 | content 3
106 | content 4
107 | content 5
108 | content 6
109 |
110 |
111 |
112 |
121 | ```
122 |
123 | ## Browser Support
124 |
125 | - Google Chrome
126 | - Mozilla Firefox
127 | - Microsoft Edge
128 | - Safari
129 |
130 | # Changelog
131 | ## [2.1.1] - 2020-11-26
132 | ### Updated
133 | - javascript statement issue fix
134 | - version updated
135 | - test php script bug is fixed
136 |
137 | ## [2.1] - 2020-05-01
138 | ### Updated
139 | - pagination bug fixed for last page items
140 | ### Added
141 | - test examples added
142 | - ES6 standard is followed
143 |
144 | ## [2.0] - 2020-01-01
145 | ### Added
146 | - bootstrap 4 support added
147 |
148 | ## [1.0] - 2019
149 | ### Added
150 | - project initialized
151 |
152 | ## Author
153 |
154 | * **Sabbir Hossain (Rupom)** - *Web Developer* - [https://sabbirrupom.com/](https://sabbirrupom.com/)
155 |
156 | [⬆ back to top](#topics-list-container)
157 |
--------------------------------------------------------------------------------
/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
Simple Pagination Example
48 | Show/Hide items and paginate after loading all
49 | built in jQuery with bootstrap-3 pagination class
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
Various songs are listed below:
60 |
61 |
#
Song
Artist
Year
62 |
63 |
64 |
65 |
{count}
66 |
{song}
67 |
{artist}
68 |
{year}
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/test/example-1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
59 |
60 |
61 |
68 |
69 |
70 |
71 |
72 |
73 |
Simple Pagination Example
74 |
Show/Hide items and paginate after loading all
75 |
built in jQuery with bootstrap pagination class
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
Various songs are listed below:
86 |
87 |
#
Song
Artist
Year
88 |
89 |
90 |
91 |
{count}
92 |
{song}
93 |
{artist}
94 |
{year}
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
154 |
155 |
156 |
--------------------------------------------------------------------------------
/test/example-2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
59 |
60 |
61 |
68 |
69 |
70 |
71 |
72 |
73 |
Simple Pagination Example
74 |
Refresh page with limit & offset query string to paginate
75 |
built in jQuery with bootstrap pagination class
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
Various songs are listed below:
86 |
87 |
#
Song
Artist
Year
88 |
89 |
90 |
91 |
{count}
92 |
{song}
93 |
{artist}
94 |
{year}
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/test/example-3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
59 |
60 |
61 |
68 |
69 |
70 |
71 |
72 |
73 |
Simple Pagination Example
74 |
Paginate items through form submission by post method
75 |
built in jQuery with bootstrap pagination class
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
92 |
Various songs are listed below:
93 |
94 |
#
Song
Artist
Year
95 |
96 |
97 |
98 |
{count}
99 |
{song}
100 |
{artist}
101 |
{year}
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
170 |
171 |
172 |
--------------------------------------------------------------------------------
/pagination.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jquery-rpmPagination - v2.1.1
3 | * A jQuery plugin for simple dynamic frontend pagination with Bootstrap CSS
4 | * https://github.com/sabbir-rupom/pagination-jquery
5 | *
6 | * Copyright 2020, Sabbir Hossain Rupom
7 | */
8 |
9 | /* jshint esversion: 6 */
10 | (function ($) {
11 | "use strict";
12 | /**
13 | * Plugin root function rpmPagination()
14 | *
15 | * @param object options Option parameter for intializing pagination plugin
16 | * *-----* {property} limit Pagination item limit, [ optional ] default is 10
17 | * *-----* {property} total Pagination item count in total [ optional ]
18 | * *-----* {property} currentPage Current/Active page number of pagination
19 | * *-----* {property} domElement Html element [tag/class] which will be count as Pagination item
20 | * *-------------------------------[ must be provided for dynamic pagination without page refresh, optional otherwise ]
21 | * *-----* {property} refresh Page refresh flag, if enabled- page will be refreshed with query/get/post parameters [ optional ]
22 | * *-----* {property} link Page refresh link [ must be provided if refresh flag is enabled, optional otherwise ]
23 | * *-----* {property} formElement Pagination item filter form identity element [ optional ]
24 | * *-------------------------------[ If page has custom item search filter form, the pagination function will use the form to refresh the page with limit/offset parameters ]
25 | *
26 | * @returns boolean true
27 | */
28 |
29 | var bsVersion = 3;
30 | if(typeof $.fn.tooltip !== 'undefined') {
31 | bsVersion = $.fn.tooltip.Constructor.VERSION.split('.')[0];
32 | }
33 | var rpmListClass = 'page-num',
34 | rpmAnchorClass = '', rpmHideClass = 'hide';
35 |
36 | $.fn.rpmPagination = function (options) {
37 | var settings = $.extend({
38 | limit: 10,
39 | total: 0,
40 | currentPage: 1,
41 | domElement: '.p-item',
42 | refresh: false,
43 | link: null,
44 | formElement: null
45 | }, options);
46 |
47 | let $this = $(this),
48 | pages = 1,
49 | rpmPageNext = settings.limit,
50 | rpmPageTotal = settings.total,
51 | tBool = false,
52 | rpmPageDomElem = settings.domElement, rpmCustomDomElem = 'p-' + Math.random().toString(36).substr(2, 6),
53 | version = bsVersion[0];
54 |
55 | if (version == 4) {
56 | rpmListClass = 'page-item ' + rpmListClass;
57 | rpmHideClass = 'd-none';
58 | rpmAnchorClass = 'page-link';
59 | }
60 |
61 | if (rpmPageTotal <= 0) {
62 | tBool = true;
63 | }
64 |
65 | $(rpmPageDomElem).each(function (i, obj) {
66 | if (tBool) {
67 | rpmPageTotal = i + 1;
68 | }
69 | $(obj).addClass(rpmCustomDomElem);
70 | $(obj).addClass(rpmCustomDomElem + '-' + parseInt(i + 1));
71 | });
72 |
73 | if (rpmPageTotal > settings.limit) {
74 | pages = parseInt(rpmPageTotal / settings.limit);
75 | if(rpmPageTotal % settings.limit > 0) {
76 | pages += 1;
77 | }
78 | }
79 |
80 | preparePageMenus(settings.currentPage, pages, $this);
81 |
82 | [settings.currentPage, rpmPageNext] = preparePageItems(settings.currentPage, rpmPageNext, settings.limit, rpmCustomDomElem, 'page-num');
83 |
84 | if (settings.refresh && $('.' + rpmCustomDomElem).length > 0) {
85 | $('.' + rpmCustomDomElem).removeClass(rpmHideClass);
86 | }
87 |
88 | /**
89 | * Process html pagination on pagination-menu click
90 | */
91 | $(document).on('click', '.page-num > a', function (e) {
92 | e.preventDefault();
93 |
94 | if ($(this).parent().hasClass('disabled') || $(this).parent($this).length === 0) {
95 | return false;
96 | } else {
97 | if (settings.refresh === true) {
98 | refreshPageforItems($(this), settings.currentPage, settings.limit, settings.link, settings.formElement);
99 | } else {
100 | if ($(this).parent().hasClass('prev')) {
101 | [settings.currentPage, rpmPageNext] = preparePageItems(settings.currentPage, rpmPageNext, settings.limit, rpmCustomDomElem, 'prev');
102 | } else if ($(this).parent().hasClass('next')) {
103 | [settings.currentPage, rpmPageNext] = preparePageItems(settings.currentPage, rpmPageNext, settings.limit, rpmCustomDomElem, 'next');
104 | } else {
105 | let cl = $(this).data('page_no');
106 | settings.currentPage = parseInt(cl);
107 | [settings.currentPage, rpmPageNext] = preparePageItems(settings.currentPage, rpmPageNext, settings.limit, rpmCustomDomElem, 'page-num');
108 | }
109 | }
110 |
111 | preparePageMenus(settings.currentPage, pages, $this);
112 | }
113 |
114 | });
115 |
116 | return true;
117 | };
118 |
119 | /**
120 | *
121 | * @param {obj} obj Pagination item anchor object
122 | * @param {int} current Current page number
123 | * @param {int} limit Pagination item limit
124 | * @param {string} url Custom source url for passing query parameters
125 | * @param {string} form Query-Element-String to determined existing form
126 | * @returns {} nothing
127 | */
128 | function refreshPageforItems(obj, current, limit, url, form) {
129 | let offset = 0;
130 |
131 | if (obj.parent().hasClass('prev')) {
132 | offset = limit * (current - 2);
133 | } else if (obj.parent().hasClass('next')) {
134 | offset = limit * current;
135 |
136 | } else {
137 | let cl = obj.data('page_no');
138 | current = parseInt(cl);
139 | offset = limit * (current - 1);
140 | }
141 |
142 | let ap;
143 | if (form === null || form === '' || $(form).length <= 0) {
144 | ap = '?';
145 | if (url.includes('?')) {
146 | ap = '&';
147 | }
148 |
149 | window.location.href = url + ap + 'limit=' + limit + '&offset=' + offset;
150 | } else {
151 | form = $(form);
152 | }
153 |
154 | form.append($(" ").attr("type", "hidden").attr("name", "limit").attr("value", limit));
155 | form.append($(" ").attr("type", "hidden").attr("name", "offset").attr("value", offset)).submit();
156 |
157 | return;
158 | }
159 |
160 | /**
161 | * Show / Hide pagination items based on current page-menu
162 | *
163 | * @param {num} current_page Current page number
164 | * @param {num} next Number of next pagination item
165 | * @param {num} limit Pagination item limit to show in frontend
166 | * @param {string} element Pagination item element
167 | * @param {string} type Type of pagination menu
168 | * @returns {Array} [ Current page number and Number of next pagination item ]
169 | */
170 | var preparePageItems = function (current_page, next, limit, element, type) {
171 |
172 | $('.' + element).addClass(rpmHideClass);
173 |
174 | var current = 0;
175 |
176 | if (type === 'prev') {
177 | next = next - limit;
178 | current = next - limit + 1;
179 | for (let i = current; i <= next; i++) {
180 | $('.' + element + '-' + i).removeClass(rpmHideClass);
181 | }
182 | current_page--;
183 |
184 | } else if (type === 'next') {
185 | current = next + 1;
186 | next = next + limit;
187 | for (let i = current; i <= next; i++) {
188 | $('.' + element + '-' + i).removeClass(rpmHideClass);
189 | }
190 | current_page++;
191 | } else if (type === 'page-num') {
192 | current = (limit * (current_page - 1)) + 1;
193 | next = (limit * (current_page - 1)) + limit;
194 | for (let i = current; i <= next; i++) {
195 | $('.' + element + '-' + i).removeClass(rpmHideClass);
196 | }
197 | }
198 |
199 | return [current_page, next];
200 | };
201 |
202 | /**
203 | * Rearrage pagination menu after each pagination item list transition
204 | *
205 | * @param {num} current_page
206 | * @param {num} pages
207 | * @param {string} element
208 | * @returns {boolean} true
209 | */
210 | var preparePageMenus = function (current_page, pages, element) {
211 |
212 | $(element).html('');
213 | let pageArray = [], fp = 1, lp = pages;
214 | let menuHtml = '';
215 |
216 | if (lp <= 6) {
217 | for (let i = 1; i <= lp; i++) {
218 | pageArray.push(i);
219 | }
220 | } else if (Math.abs(current_page - fp) < 3) {
221 | pageArray = [1, 2, 3, 4, '...', lp];
222 | } else if (Math.abs(current_page - lp) < 3) {
223 | pageArray = [1, '...', lp - 3, lp - 2, lp - 1, lp];
224 | } else {
225 | pageArray = [1, '...', current_page - 1, current_page, current_page + 1, '...', lp];
226 | }
227 |
228 | menuHtml = 'prev ';
229 | for (let i = 0; i < pageArray.length; i++) {
230 | if (lp <= i) {
231 | break;
232 | } else {
233 |
234 | if (pageArray[i] === '...') {
235 | menuHtml += '... ';
236 | } else {
237 | menuHtml += '' + pageArray[i] + ' ';
238 | }
239 | }
240 | }
241 | menuHtml += 'next ';
242 | $(element).append(menuHtml);
243 |
244 | return true;
245 | };
246 |
247 | })(jQuery);
248 |
--------------------------------------------------------------------------------
/test/example.process.php:
--------------------------------------------------------------------------------
1 |
6 | * @version 2.0
7 | * @link https://github.com/sabbir-rupom/pagination-jquery
8 | */
9 |
10 | # Get data resource
11 | $data = getData('data.json');
12 |
13 | $method = $song = $artist = '';
14 | $offset = $itemCount = 0;
15 | $limit = 10;
16 |
17 | if (!empty($_GET)) {
18 | $method = 'get';
19 | } else if (!empty($_POST)) {
20 | $method = 'post';
21 | $song = !empty($_POST['song']) ? trim($_POST['song']) : '';
22 | $artist = !empty($_POST['artist']) ? trim($_POST['artist']) : '';
23 |
24 | $nArr = [];
25 | foreach ($data as $value) {
26 | if (!empty($song) && empty($artist)) {
27 | if (stristr($value['song'], $song)) {
28 | $nArr[] = $value;
29 | }
30 | } elseif (!empty($artist) && empty($song)) {
31 | if (stristr($value['artist'], $artist)) {
32 | $nArr[] = $value;
33 | }
34 | } elseif (!empty($artist) && !empty($song)) {
35 | if (stristr($value['artist'], $artist) && stristr($value['song'], $song)) {
36 | $nArr[] = $value;
37 | }
38 | } else {
39 | $nArr[] = $value;
40 | }
41 | }
42 | $data = $nArr;
43 | }
44 |
45 | $limit = isset($_REQUEST['limit']) ? intval($_REQUEST['limit']) : $limit;
46 | $offset = isset($_REQUEST['offset']) ? intval($_REQUEST['offset']) : $offset;
47 | $itemCount = count($data);
48 |
49 | $activeMenu = ($method === 'post') ? 3 : (isset($_REQUEST['limit']) ? 2 : 1);
50 | ?>
51 |
52 |
53 |
54 |
55 | Simple Pagination Bootstrap/jQuery
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | RPM Pagination
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
122 |
123 |
124 |
125 |
126 |
Simple Pagination Example
127 |
= $method == 'post' ? 'Paginate items through form submission by post method' : 'Refresh page with limit & offset query string to paginate' ?>
128 |
built in jQuery with bootstrap pagination class
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
141 |
148 |
151 |
Various songs are listed below:
152 |
153 |
#
Song
Artist
Year
154 |
155 | $value) {
158 | $c = ($key + 1);
159 | if ($offset < $c && ($limit + $offset > $key)) {
160 | ?>
161 |
162 |
= $c ?>
163 |
= $value['song'] ?>
164 |
= $value['artist'] ?>
165 |
= $value['year'] ?>
166 |
167 | $limit) {
172 | ?>
173 |
174 |
175 |
176 |
177 |
178 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
211 |
212 |
213 |
214 | getTraceAsString());
236 | }
237 |
238 | return $data;
239 | }
240 |
--------------------------------------------------------------------------------
/test/data.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "song": "The Look of Love",
4 | "artist": "ABC",
5 | "year": "1982"
6 | },
7 | {
8 | "song": "The Shining",
9 | "artist": "Badly Drawn Boy",
10 | "year": "2000"
11 | },
12 | {
13 | "song": "God Only Knows",
14 | "artist": "The Beach Boys",
15 | "year": "1966"
16 | },
17 | {
18 | "song": "Good Vibrations",
19 | "artist": "The Beach Boys",
20 | "year": "1966"
21 | },
22 | {
23 | "song": "Wouldn’t It Be Nice",
24 | "artist": "The Beach Boys",
25 | "year": "1966"
26 | },
27 | {
28 | "song": "Eight Days a Week",
29 | "artist": "The Beatles",
30 | "year": "1964"
31 | },
32 | {
33 | "song": "Girl",
34 | "artist": "The Beatles",
35 | "year": "1965"
36 | },
37 | {
38 | "song": "I Want to Hold Your Hand",
39 | "artist": "The Beatles",
40 | "year": "1963"
41 | },
42 | {
43 | "song": "She Loves You",
44 | "artist": "The Beatles",
45 | "year": "1963"
46 | },
47 | {
48 | "song": "Something",
49 | "artist": "The Beatles",
50 | "year": "1969"
51 | },
52 | {
53 | "song": "With a Little Help from My Friends",
54 | "artist": "The Beatles",
55 | "year": "1967"
56 | },
57 | {
58 | "song": "Song for Whoever",
59 | "artist": "The Beautiful South",
60 | "year": "1989"
61 | },
62 | {
63 | "song": "How Deep is Your Love?",
64 | "artist": "The Bee Gees",
65 | "year": "1977"
66 | },
67 | {
68 | "song": "Sweet Little Sixteen",
69 | "artist": "Chuck Berry",
70 | "year": "1958"
71 | },
72 | {
73 | "song": "Crazy in Love",
74 | "artist": "Beyoncé",
75 | "year": "2003"
76 | },
77 | {
78 | "song": "Thirteen",
79 | "artist": "Big Star",
80 | "year": "1972"
81 | },
82 | {
83 | "song": "I’ll Take Care of You",
84 | "artist": "Bobby “Blue” Bland",
85 | "year": "1959"
86 | },
87 | {
88 | "song": "Heroes",
89 | "artist": "David Bowie",
90 | "year": "1977"
91 | },
92 | {
93 | "song": "The Wedding Song",
94 | "artist": "David Bowie",
95 | "year": "1993"
96 | },
97 | {
98 | "song": "Sit Down I Think I Love You",
99 | "artist": "Buffalo Springfield",
100 | "year": "1966"
101 | },
102 | {
103 | "song": "Everybody Needs Somebody to Love",
104 | "artist": "Solomon Burke",
105 | "year": "1964"
106 | },
107 | {
108 | "song": "Mehbooba Mehbooba",
109 | "artist": "R D Burman",
110 | "year": "1975"
111 | },
112 | {
113 | "song": "Hounds of Love",
114 | "artist": "Kate Bush",
115 | "year": "1985"
116 | },
117 | {
118 | "song": "The Man With the Child in His Eyes",
119 | "artist": "Kate Bush",
120 | "year": "1978"
121 | },
122 | {
123 | "song": "The Man I Love",
124 | "artist": "Kate Bush",
125 | "year": "1994"
126 | },
127 | {
128 | "song": "Love Me Forever",
129 | "artist": "Carlton and the Shoes",
130 | "year": "1968"
131 | },
132 | {
133 | "song": "The Dark End of the Street",
134 | "artist": "James Carr",
135 | "year": "1967"
136 | },
137 | {
138 | "song": "I Walk the Line",
139 | "artist": "Johnny Cash",
140 | "year": "1956"
141 | },
142 | {
143 | "song": "Deanna",
144 | "artist": "Nick Cave and the Bad Seeds",
145 | "year": "1988"
146 | },
147 | {
148 | "song": "I Got a Woman",
149 | "artist": "Ray Charles",
150 | "year": "1954"
151 | },
152 | {
153 | "song": "Stoned Out of My Mind",
154 | "artist": "The Chi-Lites",
155 | "year": "1973"
156 | },
157 | {
158 | "song": "That’s How Long",
159 | "artist": "The Chi-Lites",
160 | "year": "1974"
161 | },
162 | {
163 | "song": "Stay Free",
164 | "artist": "The Clash",
165 | "year": "1978"
166 | },
167 | {
168 | "song": "Private Number",
169 | "artist": "Judy Clay and William Bell",
170 | "year": "1968"
171 | },
172 | {
173 | "song": "Yellow",
174 | "artist": "Coldplay",
175 | "year": "2000"
176 | },
177 | {
178 | "song": "Do You Love Me?",
179 | "artist": "The Contours",
180 | "year": "1962"
181 | },
182 | {
183 | "song": "Cupid",
184 | "artist": "Sam Cooke",
185 | "year": "1961"
186 | },
187 | {
188 | "song": "I’m in the Mood Again",
189 | "artist": "Elvis Costello",
190 | "year": "2003"
191 | },
192 | {
193 | "song": "Jack of All Parades",
194 | "artist": "Elvis Costello and the Attractions",
195 | "year": "1986"
196 | },
197 | {
198 | "song": "Then He Kissed Me",
199 | "artist": "The Crystals",
200 | "year": "1963"
201 | },
202 | {
203 | "song": "Friday I’m in Love",
204 | "artist": "The Cure",
205 | "year": "1992"
206 | },
207 | {
208 | "song": "Pour Some Sugar on Me",
209 | "artist": "Def Leppard",
210 | "year": "1987"
211 | },
212 | {
213 | "song": "Born to Be With You",
214 | "artist": "Dion",
215 | "year": "1975"
216 | },
217 | {
218 | "song": "A Teenager in Love",
219 | "artist": "Dion & the Belmonts",
220 | "year": "1960"
221 | },
222 | {
223 | "song": "Blueberry Hill",
224 | "artist": "Fats Domino",
225 | "year": "1956"
226 | },
227 | {
228 | "song": "Girl from the North Country",
229 | "artist": "Bob Dylan",
230 | "year": "1963"
231 | },
232 | {
233 | "song": "Visions of Johanna",
234 | "artist": "Bob Dylan",
235 | "year": "1966"
236 | },
237 | {
238 | "song": "Wedding Song",
239 | "artist": "Bob Dylan",
240 | "year": "1974"
241 | },
242 | {
243 | "song": "One Day Like This",
244 | "artist": "Elbow",
245 | "year": "2008"
246 | },
247 | {
248 | "song": "Let’s Stick Together",
249 | "artist": "Bryan Ferry",
250 | "year": "1976"
251 | },
252 | {
253 | "song": "Ev’ry Time We Say Goodbye",
254 | "artist": "Ella Fitzgerald",
255 | "year": "1956"
256 | },
257 | {
258 | "song": "Killing Me Softly With His Song",
259 | "artist": "Roberta Flack",
260 | "year": "1973"
261 | },
262 | {
263 | "song": "I Never Loved a Man (The Way I Love You)",
264 | "artist": "Aretha Franklin",
265 | "year": "1967"
266 | },
267 | {
268 | "song": "I Say A Little Prayer",
269 | "artist": "Aretha Franklin",
270 | "year": "1968"
271 | },
272 | {
273 | "song": "The Power of Love",
274 | "artist": "Frankie Goes to Hollywood",
275 | "year": "1984"
276 | },
277 | {
278 | "song": "It’ll All Come Around",
279 | "artist": "Patsy Gallant",
280 | "year": "1978"
281 | },
282 | {
283 | "song": "Zing! Went the Strings of My Heart",
284 | "artist": "Judy Garland",
285 | "year": "1939"
286 | },
287 | {
288 | "song": "Ain’t No Mountain High Enough",
289 | "artist": "Marvin Gaye And Tammi Terrell",
290 | "year": "1967"
291 | },
292 | {
293 | "song": "You’re All I Need to Get By",
294 | "artist": "Marvin Gaye And Tammi Terrell",
295 | "year": "1968"
296 | },
297 | {
298 | "song": "The Dutchman",
299 | "artist": "Steve Goodman",
300 | "year": "1973"
301 | },
302 | {
303 | "song": "Let’s Get Married",
304 | "artist": "Al Green",
305 | "year": "1974"
306 | },
307 | {
308 | "song": "Let’s Stay Together",
309 | "artist": "Al Green",
310 | "year": "1971"
311 | },
312 | {
313 | "song": "Love and Happiness",
314 | "artist": "Al Green",
315 | "year": "1972"
316 | },
317 | {
318 | "song": "Sweet Child O’ Mine",
319 | "artist": "Guns N’ Roses",
320 | "year": "1987"
321 | },
322 | {
323 | "song": "I’m Into Something Good",
324 | "artist": "Herman’s Hermits",
325 | "year": "1964"
326 | },
327 | {
328 | "song": "How Will I Know",
329 | "artist": "Whitney Houston",
330 | "year": "1985"
331 | },
332 | {
333 | "song": "I’m So in Love",
334 | "artist": "Leroy Hutson",
335 | "year": "1973"
336 | },
337 | {
338 | "song": "I’m So Proud",
339 | "artist": "The Impressions",
340 | "year": "1964"
341 | },
342 | {
343 | "song": "Night Nurse",
344 | "artist": "Gregory Isaacs",
345 | "year": "1982"
346 | },
347 | {
348 | "song": "Summer Breeze",
349 | "artist": "The Isley Brothers",
350 | "year": "1973"
351 | },
352 | {
353 | "song": "Are You Ready For Love",
354 | "artist": "Elton John",
355 | "year": "1979"
356 | },
357 | {
358 | "song": "La Vie En Rose",
359 | "artist": "Grace Jones",
360 | "year": "1977"
361 | },
362 | {
363 | "song": "No One",
364 | "artist": "Alicia Keys",
365 | "year": "2007"
366 | },
367 | {
368 | "song": "Stand By Me",
369 | "artist": "Ben E King",
370 | "year": "1961"
371 | },
372 | {
373 | "song": "You Really Got Me",
374 | "artist": "The Kinks",
375 | "year": "1964"
376 | },
377 | {
378 | "song": "Constant Craving",
379 | "artist": "KD Lang",
380 | "year": "1992"
381 | },
382 | {
383 | "song": "Elusive Butterfly",
384 | "artist": "Bob Lind",
385 | "year": "1966"
386 | },
387 | {
388 | "song": "Is This Love?",
389 | "artist": "Bob Marley",
390 | "year": "1978"
391 | },
392 | {
393 | "song": "My Love",
394 | "artist": "Paul McCartney and Wings",
395 | "year": "1973"
396 | },
397 | {
398 | "song": "90% of Me is You",
399 | "artist": "Gwen McRae",
400 | "year": "1974"
401 | },
402 | {
403 | "song": "Angel of the Morning",
404 | "artist": "Merrilee and the Turnabouts",
405 | "year": "1968"
406 | },
407 | {
408 | "song": "Can’t Get You Out of My Head",
409 | "artist": "Kylie Minogue",
410 | "year": "2001"
411 | },
412 | {
413 | "song": "Help Me",
414 | "artist": "Joni Mitchell",
415 | "year": "1974"
416 | },
417 | {
418 | "song": "Madame George",
419 | "artist": "Van Morrison",
420 | "year": "1968"
421 | },
422 | {
423 | "song": "You’ve Got a Friend",
424 | "artist": "Randy Newman",
425 | "year": "1995"
426 | },
427 | {
428 | "song": "Oh",
429 | "artist": " Pretty Woman",
430 | "year": "Roy Orbison"
431 | },
432 | {
433 | "song": "Puppy Love",
434 | "artist": "Donny Osmond",
435 | "year": "1972"
436 | },
437 | {
438 | "song": "She",
439 | "artist": "Gram Parsons",
440 | "year": "1973"
441 | },
442 | {
443 | "song": "I Will Always Love You",
444 | "artist": "Dolly Parton",
445 | "year": "1974"
446 | },
447 | {
448 | "song": "I’m in Love",
449 | "artist": "Wilson Pickett",
450 | "year": "1967"
451 | },
452 | {
453 | "song": "She is Beyond Good and Evil",
454 | "artist": "The Pop Group",
455 | "year": "1979"
456 | },
457 | {
458 | "song": "Let’s Do It",
459 | "artist": " Let’s Fall in Love",
460 | "year": "Cole Porter"
461 | },
462 | {
463 | "song": "Can’t Help Falling in Love",
464 | "artist": "Elvis Presley",
465 | "year": "1961"
466 | },
467 | {
468 | "song": "Love Me Tender",
469 | "artist": "Elvis Presley",
470 | "year": "1956"
471 | },
472 | {
473 | "song": "I’ll Stand By You",
474 | "artist": "The Pretenders",
475 | "year": "1994"
476 | },
477 | {
478 | "song": "That Old Black Magic",
479 | "artist": "Louis Prima and Keely Smith",
480 | "year": "1959"
481 | },
482 | {
483 | "song": "Let’s Get Married",
484 | "artist": "The Proclaimers",
485 | "year": "1994"
486 | },
487 | {
488 | "song": "You’re My Best Friend",
489 | "artist": "Queen",
490 | "year": "1975"
491 | },
492 | {
493 | "song": "Kehma Hi Kya",
494 | "artist": "A R Rahman",
495 | "year": "1995"
496 | },
497 | {
498 | "song": "Unchained Melody",
499 | "artist": "The Righteous Brothers",
500 | "year": "1965"
501 | },
502 | {
503 | "song": "Umbrella",
504 | "artist": "Rihanna",
505 | "year": "2007"
506 | },
507 | {
508 | "song": "You’ve Really Got a Hold On Me",
509 | "artist": "Smokey Robinson and the Miracles",
510 | "year": "1962"
511 | },
512 | {
513 | "song": "Be My Baby",
514 | "artist": "The Ronettes",
515 | "year": "1963"
516 | },
517 | {
518 | "song": "Valerie",
519 | "artist": "Mark Ronson featuring Amy Winehouse",
520 | "year": "2007"
521 | },
522 | {
523 | "song": "I Saw the Light",
524 | "artist": "Todd Rundgren",
525 | "year": "1972"
526 | },
527 | {
528 | "song": "Leader of the Pack",
529 | "artist": "The Shangri-Las",
530 | "year": "1964"
531 | },
532 | {
533 | "song": "Will You Love Me Tomorrow?",
534 | "artist": "The Shirelles",
535 | "year": "1961"
536 | },
537 | {
538 | "song": "Bridge Over Troubled Water",
539 | "artist": "Simon and Garfunkel",
540 | "year": "1970"
541 | },
542 | {
543 | "song": "Fly Me to the Moon",
544 | "artist": "Frank Sinatra",
545 | "year": "1966"
546 | },
547 | {
548 | "song": "Get Me to the Church On Time",
549 | "artist": "Frank Sinatra",
550 | "year": "1966"
551 | },
552 | {
553 | "song": "Love and Marriage",
554 | "artist": "Frank Sinatra",
555 | "year": "1955"
556 | },
557 | {
558 | "song": "True Love Travels on a Gravel Road",
559 | "artist": "Percy Sledge",
560 | "year": "1969"
561 | },
562 | {
563 | "song": "It Must Be Love",
564 | "artist": "Labi Siffre",
565 | "year": "1971"
566 | },
567 | {
568 | "song": "Frederick",
569 | "artist": "Patti Smith",
570 | "year": "1979"
571 | },
572 | {
573 | "song": "There is a Light That Never Goes Out",
574 | "artist": "The Smiths",
575 | "year": "1986"
576 | },
577 | {
578 | "song": "I Got You Babe",
579 | "artist": "Sonny and Cher",
580 | "year": "1965"
581 | },
582 | {
583 | "song": "You Gotta Come a Little Closer",
584 | "artist": "Soul Brothers Six",
585 | "year": "1973"
586 | },
587 | {
588 | "song": "Wannabe",
589 | "artist": "The Spice Girls",
590 | "year": "1996"
591 | },
592 | {
593 | "song": "I’ll Be Around",
594 | "artist": "The Spinners",
595 | "year": "1972"
596 | },
597 | {
598 | "song": "Mandolin Wind",
599 | "artist": "Rod Stewart",
600 | "year": "1971"
601 | },
602 | {
603 | "song": "She Bangs the Drums",
604 | "artist": "The Stone Roses",
605 | "year": "1989"
606 | },
607 | {
608 | "song": "I Feel Love",
609 | "artist": "Donna Summer",
610 | "year": "1977"
611 | },
612 | {
613 | "song": "Baby Love",
614 | "artist": "The Supremes",
615 | "year": "1964"
616 | },
617 | {
618 | "song": "Stoned Love",
619 | "artist": "The Supremes",
620 | "year": "1970"
621 | },
622 | {
623 | "song": "You Can’t Hurry Love",
624 | "artist": "The Supremes",
625 | "year": "1966"
626 | },
627 | {
628 | "song": "Why Do Fools Fall in Love?",
629 | "artist": "The Teenagers featuring Frankie Lymon",
630 | "year": "1956"
631 | },
632 | {
633 | "song": "My Girl",
634 | "artist": "The Temptations",
635 | "year": "1964"
636 | },
637 | {
638 | "song": "Gloria",
639 | "artist": "Them",
640 | "year": "1964"
641 | },
642 | {
643 | "song": "Here Comes the Night",
644 | "artist": "Them/Van Morrison",
645 | "year": "1965"
646 | },
647 | {
648 | "song": "River Deep",
649 | "artist": " Mountain High",
650 | "year": "Ike and Tina Turner"
651 | },
652 | {
653 | "song": "Terry",
654 | "artist": "Twinkle",
655 | "year": "1964"
656 | },
657 | {
658 | "song": "Mad About the Boy",
659 | "artist": "Dinah Washington",
660 | "year": "1952"
661 | },
662 | {
663 | "song": "Wichita Linesman",
664 | "artist": "Jimmy Webb",
665 | "year": "1968"
666 | },
667 | {
668 | "song": "You Do Something to Me",
669 | "artist": "Paul Weller",
670 | "year": "1995"
671 | },
672 | {
673 | "song": "Music to Watch Girls By",
674 | "artist": "Andy Williams",
675 | "year": "1967"
676 | },
677 | {
678 | "song": "Do I Love You (Indeed I Do)",
679 | "artist": "Frank Wilson",
680 | "year": "1966"
681 | },
682 | {
683 | "song": "Lean on Me",
684 | "artist": "Bill Withers",
685 | "year": "1972"
686 | },
687 | {
688 | "song": "Like a Hurricane",
689 | "artist": "Neil Young",
690 | "year": "1977"
691 | },
692 | {
693 | "song": "Only Love Can Break Your Heart",
694 | "artist": "Neil Young",
695 | "year": "1970"
696 | },
697 | {
698 | "song": "Tears Are Not Enough",
699 | "artist": "ABC",
700 | "year": "1981"
701 | },
702 | {
703 | "song": "The Winner Takes It All",
704 | "artist": "Abba",
705 | "year": "1980"
706 | },
707 | {
708 | "song": "Call Me on Your Way Back Home",
709 | "artist": "Ryan Adams",
710 | "year": "2000"
711 | },
712 | {
713 | "song": "Never Ever",
714 | "artist": "All Saints",
715 | "year": "1997"
716 | },
717 | {
718 | "song": "Please Give Me Something",
719 | "artist": "Bill Allen and the Backbeats",
720 | "year": "1958"
721 | },
722 | {
723 | "song": "Without You",
724 | "artist": "Badfinger",
725 | "year": "1970"
726 | },
727 | {
728 | "song": "Diamonds and Rust",
729 | "artist": "Joan Baez",
730 | "year": "1975"
731 | },
732 | {
733 | "song": "You’ve Got to Hide Your Love Away",
734 | "artist": "The Beatles",
735 | "year": "1965"
736 | },
737 | {
738 | "song": "The Boy Done Wrong Again",
739 | "artist": "Belle and Sebastian",
740 | "year": "1996"
741 | },
742 | {
743 | "song": "Heart of Glass",
744 | "artist": "Blondie",
745 | "year": "1978"
746 | },
747 | {
748 | "song": "One Way Or Another",
749 | "artist": "Blondie",
750 | "year": "1979"
751 | },
752 | {
753 | "song": "Flume",
754 | "artist": "Bon Iver",
755 | "year": "2008"
756 | },
757 | {
758 | "song": "Bed is For Sleeping",
759 | "artist": "Bonnie ‘Prince’ Billy and Matt Sweeney",
760 | "year": "2005"
761 | },
762 | {
763 | "song": "Letter to Hermione",
764 | "artist": "David Bowie",
765 | "year": "1969"
766 | },
767 | {
768 | "song": "Repetition",
769 | "artist": "David Bowie",
770 | "year": "1979"
771 | },
772 | {
773 | "song": "He Wasn’t Man Enough",
774 | "artist": "Toni Braxton",
775 | "year": "2000"
776 | },
777 | {
778 | "song": "Lua",
779 | "artist": "Bright Eyes",
780 | "year": "2005"
781 | },
782 | {
783 | "song": "Ever Fallen in Love (With Someone You Shouldn’t’ve)",
784 | "artist": "Buzzcocks",
785 | "year": "1978"
786 | },
787 | {
788 | "song": "I Still Miss Someone",
789 | "artist": "Johnny Cash",
790 | "year": "1959"
791 | },
792 | {
793 | "song": "Far From Me",
794 | "artist": "Nick Cave",
795 | "year": "1997"
796 | },
797 | {
798 | "song": "Where Were You",
799 | "artist": "Vic Chesnutt",
800 | "year": "1991"
801 | },
802 | {
803 | "song": "Since U Been Gone",
804 | "artist": "Kelly Clarkson",
805 | "year": "2004"
806 | },
807 | {
808 | "song": "Should I Stay Or Should I Go",
809 | "artist": "The Clash",
810 | "year": "1982"
811 | },
812 | {
813 | "song": "Crazy",
814 | "artist": "Patsy Cline",
815 | "year": "1961"
816 | },
817 | {
818 | "song": "So Long",
819 | "artist": " Marianne",
820 | "year": "Leonard Cohen"
821 | },
822 | {
823 | "song": "The Scientist",
824 | "artist": "Coldplay",
825 | "year": "2002"
826 | },
827 | {
828 | "song": "Against All Odds (Take a Look at Me Now)",
829 | "artist": "Phil Collins",
830 | "year": "1984"
831 | },
832 | {
833 | "song": "Don’t Leave Me This Way",
834 | "artist": "The Communards",
835 | "year": "1986"
836 | },
837 | {
838 | "song": "Either Side of the Same Town",
839 | "artist": "Elvis Costello",
840 | "year": "2004"
841 | },
842 | {
843 | "song": "I Hope You’re Happy Now",
844 | "artist": "Elvis Costello and the Attractions",
845 | "year": "1986"
846 | },
847 | {
848 | "song": "I Want You",
849 | "artist": "Elvis Costello and the Attractions",
850 | "year": "1986"
851 | },
852 | {
853 | "song": "He Hit Me (And it Felt Like a Kiss)",
854 | "artist": "The Crystals",
855 | "year": "1962"
856 | },
857 | {
858 | "song": "Disintegration",
859 | "artist": "The Cure",
860 | "year": "1989"
861 | },
862 | {
863 | "song": "Katie Cruel",
864 | "artist": "Karen Dalton",
865 | "year": "1971"
866 | },
867 | {
868 | "song": "Layla",
869 | "artist": "Derek and the Dominos",
870 | "year": "1970"
871 | },
872 | {
873 | "song": "Warwick Avenue",
874 | "artist": "Duffy",
875 | "year": "2008"
876 | },
877 | {
878 | "song": "Don’t Think Twice",
879 | "artist": " It’s All Right",
880 | "year": "Bob Dylan"
881 | },
882 | {
883 | "song": "Idiot Wind",
884 | "artist": "Bob Dylan",
885 | "year": "1975"
886 | },
887 | {
888 | "song": "If You See Her",
889 | "artist": " Say Hello",
890 | "year": "Bob Dylan"
891 | }
892 | ]
893 |
--------------------------------------------------------------------------------