回答編集履歴

4

chousei

2019/03/12 06:17

投稿

yambejp
yambejp

スコア114863

test CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  $.ajax({
36
36
 
37
- url:"y.php",
37
+ url:"sample.txt",
38
38
 
39
39
  dataType:'text',
40
40
 

3

chousei

2019/03/12 06:17

投稿

yambejp
yambejp

スコア114863

test CHANGED
@@ -25,3 +25,29 @@
25
25
  });
26
26
 
27
27
  ```
28
+
29
+ # エラー検証
30
+
31
+ ```javascript
32
+
33
+ $(function(){
34
+
35
+ $.ajax({
36
+
37
+ url:"y.php",
38
+
39
+ dataType:'text',
40
+
41
+ }).done(function(data){
42
+
43
+ console.log(data);
44
+
45
+ }).fail(function(xhr,err,status){
46
+
47
+ console.log([err,status]);
48
+
49
+ });
50
+
51
+ });
52
+
53
+ ```

2

ちょうせい

2019/03/12 06:17

投稿

yambejp
yambejp

スコア114863

test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  $.ajax({
14
14
 
15
- url:'y.php',
15
+ url:"sample.txt",
16
16
 
17
17
  dataType:'text',
18
18
 

1

chousei

2019/03/12 05:33

投稿

yambejp
yambejp

スコア114863

test CHANGED
@@ -3,3 +3,25 @@
3
3
  $.get("sample.txt").done(function(data){$('div').text(data);});
4
4
 
5
5
  ```
6
+
7
+ もしくは
8
+
9
+ ```javascript
10
+
11
+ $(function(){
12
+
13
+ $.ajax({
14
+
15
+ url:'y.php',
16
+
17
+ dataType:'text',
18
+
19
+ }).done(function(data){
20
+
21
+ $('div').text(data);
22
+
23
+ });
24
+
25
+ });
26
+
27
+ ```