回答編集履歴

4

誤記の訂正

2019/07/01 14:18

投稿

syuus
syuus

スコア403

test CHANGED
@@ -54,7 +54,7 @@
54
54
 
55
55
  data: {
56
56
 
57
- 'test': 'data',
57
+ test: 'data',
58
58
 
59
59
  },
60
60
 

3

func_exampleの変更

2019/07/01 14:18

投稿

syuus
syuus

スコア403

test CHANGED
@@ -36,11 +36,7 @@
36
36
 
37
37
  if (result) {
38
38
 
39
- func_example('「OK」が選択されました。');
39
+ func_example();
40
-
41
- } else {
42
-
43
- func_example('「キャンセル」が選択されました。');
44
40
 
45
41
  }
46
42
 
@@ -48,11 +44,27 @@
48
44
 
49
45
 
50
46
 
51
- function func_example(text) {
47
+ function func_example() {
52
48
 
53
- $(function() {
49
+ $.ajax({
54
50
 
51
+ url: './request.php',
52
+
53
+ type: 'POST',
54
+
55
+ data: {
56
+
57
+ 'test': 'data',
58
+
59
+ },
60
+
61
+ }).done(() => {
62
+
55
- $('#text').text(text);
63
+ $('#text').text('成功');
64
+
65
+ }).fail(() => {
66
+
67
+ $('#text').text('失敗');
56
68
 
57
69
  });
58
70
 

2

質問内容にきちんと回答できていなかったのを訂正

2019/07/01 14:14

投稿

syuus
syuus

スコア403

test CHANGED
@@ -18,7 +18,15 @@
18
18
 
19
19
  <body>
20
20
 
21
+ <div id="text"></div>
22
+
21
23
  <button id="button">クリック</button>
24
+
25
+ <script src="https://code.jquery.com/jquery-3.4.1.js"
26
+
27
+ integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
28
+
29
+ crossorigin="anonymous"></script>
22
30
 
23
31
  <script>
24
32
 
@@ -28,15 +36,27 @@
28
36
 
29
37
  if (result) {
30
38
 
31
- console.log('「OK」が選択されました。');
39
+ func_example('「OK」が選択されました。');
32
40
 
33
41
  } else {
34
42
 
35
- console.log('「キャンセル」が選択されました。');
43
+ func_example('「キャンセル」が選択されました。');
36
44
 
37
45
  }
38
46
 
39
47
  });
48
+
49
+
50
+
51
+ function func_example(text) {
52
+
53
+ $(function() {
54
+
55
+ $('#text').text(text);
56
+
57
+ });
58
+
59
+ }
40
60
 
41
61
  </script>
42
62
 

1

リンクの訂正

2019/06/30 15:09

投稿

syuus
syuus

スコア403

test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- https://developer.mozilla.org/ja/docs/Web/API/Window/confirm
5
+ [window.confirm - Web API | MDN](https://developer.mozilla.org/ja/docs/Web/API/Window/confirm)
6
6
 
7
7
 
8
8