jsonデータから50件(最大数は決まってません)ある一覧を作成しています。
js
1$.ajax({ 2 url: "jsonデータのurl", 3 dataType: "json", 4 async: false, 5 success: function (data) { 6 var output = ''; 7 for (var i = 0; i < data.length; i++) { 8 output+= '<h3>'+data[i].title+'</h3>'; 9 } 10 $('#output').append(output); 11 } 12 });
これを10件づつページ分割(ページネーション)する方法を探しています。
配列から作成した一覧をページ分割する方法が見つけれませんでした。
json
1[ 2 { 3 "title": "\u30bf\u30a4\u30c8\u30eb0" 4 }, 5 { 6 "title": "\u30bf\u30a4\u30c8\u30eb1" 7 }, 8 { 9 "title": "\u30bf\u30a4\u30c8\u30eb2" 10 }, 11 { 12 "title": "\u30bf\u30a4\u30c8\u30eb3" 13 }, 14 { 15 "title": "\u30bf\u30a4\u30c8\u30eb4" 16 }, 17 { 18 "title": "\u30bf\u30a4\u30c8\u30eb5" 19 }, 20 { 21 "title": "\u30bf\u30a4\u30c8\u30eb6" 22 }, 23 { 24 "title": "\u30bf\u30a4\u30c8\u30eb7" 25 }, 26 { 27 "title": "\u30bf\u30a4\u30c8\u30eb8" 28 }, 29 { 30 "title": "\u30bf\u30a4\u30c8\u30eb9" 31 }, 32 { 33 "title": "\u30bf\u30a4\u30c8\u30eb10" 34 }, 35 { 36 "title": "\u30bf\u30a4\u30c8\u30eb11" 37 }, 38 { 39 "title": "\u30bf\u30a4\u30c8\u30eb12" 40 }, 41 { 42 "title": "\u30bf\u30a4\u30c8\u30eb13" 43 }, 44 { 45 "title": "\u30bf\u30a4\u30c8\u30eb14" 46 }, 47 { 48 "title": "\u30bf\u30a4\u30c8\u30eb15" 49 }, 50 { 51 "title": "\u30bf\u30a4\u30c8\u30eb16" 52 }, 53 { 54 "title": "\u30bf\u30a4\u30c8\u30eb17" 55 }, 56 { 57 "title": "\u30bf\u30a4\u30c8\u30eb18" 58 }, 59 { 60 "title": "\u30bf\u30a4\u30c8\u30eb19" 61 } 62]
最終目標はjsonデータから一覧を作成し、
Masonryのプラグインを使ってinfinity scroll出来るまでが目標です。
よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/26 05:05
2017/07/26 05:07
2017/07/26 05:35
2017/07/26 05:56
2017/07/26 07:40
2017/07/26 07:42
2017/07/26 07:43
2017/07/26 07:50 編集
2017/07/26 08:00
2017/07/26 08:00
2017/07/26 08:10
2017/07/26 08:18
2017/07/26 08:19
2017/07/26 08:23 編集
2017/07/26 08:36
2017/07/26 09:00
2017/07/27 01:45