回答編集履歴
4
chousei
answer
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
```javascript
|
17
17
|
$(function(){
|
18
18
|
$.ajax({
|
19
|
-
url:"
|
19
|
+
url:"sample.txt",
|
20
20
|
dataType:'text',
|
21
21
|
}).done(function(data){
|
22
22
|
console.log(data);
|
3
chousei
answer
CHANGED
@@ -11,4 +11,17 @@
|
|
11
11
|
$('div').text(data);
|
12
12
|
});
|
13
13
|
});
|
14
|
+
```
|
15
|
+
# エラー検証
|
16
|
+
```javascript
|
17
|
+
$(function(){
|
18
|
+
$.ajax({
|
19
|
+
url:"y.php",
|
20
|
+
dataType:'text',
|
21
|
+
}).done(function(data){
|
22
|
+
console.log(data);
|
23
|
+
}).fail(function(xhr,err,status){
|
24
|
+
console.log([err,status]);
|
25
|
+
});
|
26
|
+
});
|
14
27
|
```
|
2
ちょうせい
answer
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
```javascript
|
6
6
|
$(function(){
|
7
7
|
$.ajax({
|
8
|
-
url:
|
8
|
+
url:"sample.txt",
|
9
9
|
dataType:'text',
|
10
10
|
}).done(function(data){
|
11
11
|
$('div').text(data);
|
1
chousei
answer
CHANGED
@@ -1,3 +1,14 @@
|
|
1
1
|
```javascript
|
2
2
|
$.get("sample.txt").done(function(data){$('div').text(data);});
|
3
|
+
```
|
4
|
+
もしくは
|
5
|
+
```javascript
|
6
|
+
$(function(){
|
7
|
+
$.ajax({
|
8
|
+
url:'y.php',
|
9
|
+
dataType:'text',
|
10
|
+
}).done(function(data){
|
11
|
+
$('div').text(data);
|
12
|
+
});
|
13
|
+
});
|
3
14
|
```
|