回答編集履歴

1

2015/02/12 03:05

投稿

dai5566
dai5566

スコア57

test CHANGED
@@ -1,35 +1,16 @@
1
1
  history.pushStateを使いましょう。
2
-
3
-
4
2
 
5
3
  JSのリンクをソートとページングの為に設定しましょう。
6
4
 
7
-
8
-
9
5
  コード例を以下に示します。
10
6
 
11
-
12
-
13
- ```lang-<ここに言語を入力>
14
-
15
7
  if (history && history.pushState) {
16
-
17
- $('.tableClass th a, .paginationBar .controles a').on('click', function () {
8
+ $('.tableClass th a, .paginationBar .controles a').on('click', function () {
18
-
19
- $.getScript(this.href);
9
+ $.getScript(this.href);
20
-
21
- history.pushState(null, document.title, this.href);
10
+ history.pushState(null, document.title, this.href);
22
-
23
- return false;
11
+ return false;
24
-
25
- })
12
+ })
26
-
27
- $(window).bind("popstate", function () {
13
+ $(window).bind("popstate", function () {
28
-
29
- $.getScript(location.href);
14
+ $.getScript(location.href);
30
-
31
- });
15
+ });
32
-
33
16
  }
34
-
35
- ```