質問編集履歴

1

success/errorの書き方がjQuery1\.8以降非推奨だったらしいので\(http://www\.tohoho-web\.com/js/jquery/ajax\.htm\)done/failに変更

2016/05/03 12:13

投稿

yohira0616
yohira0616

スコア255

test CHANGED
File without changes
test CHANGED
@@ -72,13 +72,13 @@
72
72
 
73
73
  dataType: 'JSON'
74
74
 
75
- }).success(function (response) {
75
+ }).done(function (response) {
76
76
 
77
77
  console.log('post done');
78
78
 
79
79
  console.log(response);
80
80
 
81
- }).error(function(error){
81
+ }).fail(function(error){
82
82
 
83
83
  console.log('post error');
84
84
 
@@ -174,13 +174,13 @@
174
174
 
175
175
  dataType: 'JSON'
176
176
 
177
- }).success(function (response) {
177
+ }).done(function (response) {
178
178
 
179
179
  console.log('done!');
180
180
 
181
181
  console.log(response);
182
182
 
183
- }).error((error)=> {
183
+ }).fail((error)=> {
184
184
 
185
185
  console.log('error!');
186
186
 
@@ -200,7 +200,7 @@
200
200
 
201
201
 
202
202
 
203
- success/errorではなくthen/catchメソッドを使って実装しても効果なし(ステータスコード200でcatch側のメソッドが実行される)
203
+ done/failではなくthen/catchメソッドを使って実装しても効果なし(ステータスコード200でcatch側のメソッドが実行される)
204
204
 
205
205
 
206
206