Skip to content

Commit

Permalink
jQuery change .error to .fail
Browse files Browse the repository at this point in the history
https://api.jquery.com/jquery.post/

jQuery has removed the error, success, and complete functions from ajax operations and replaced them with done, fail, and always
  • Loading branch information
wilpig committed Aug 29, 2023
1 parent b8c0bba commit 5a783a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ function updatestatus(e){
window.picturepathupdated=false;
}
}
}).error(function(){
}).fail(function(){
$('#messages').text('Something is broken');
});
}
Expand Down
2 changes: 1 addition & 1 deletion devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ function getfirstport(devicecalling, devid) {
}).then(refreshdevice($('#DeviceType').val(),$('#DeviceID').val(),true));
});
});
}).error(function(data){
}).fail(function(data){
$('#messages').text('data.message');
});

Expand Down
6 changes: 3 additions & 3 deletions repository_sync_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ function AddImage(imageURL){

// Create ports
for(var i in row.data("globaldataports")){
$.ajax({type: postorput,url: 'api/v1/devicetemplate/'+data.devicetemplate.TemplateID+'/dataport/'+(parseInt(i)+1),async: false,data: row.data("globaldataports")[i]}).complete(function(data){});
$.ajax({type: postorput,url: 'api/v1/devicetemplate/'+data.devicetemplate.TemplateID+'/dataport/'+(parseInt(i)+1),async: false,data: row.data("globaldataports")[i]}).always(function(data){});
}
for(var i in row.data("globalpowerports")){
$.ajax({type: postorput,url: 'api/v1/devicetemplate/'+data.devicetemplate.TemplateID+'/powerport/'+(parseInt(i)+1),async: false,data: row.data("globalpowerports")[i]}).complete(function(data){});
$.ajax({type: postorput,url: 'api/v1/devicetemplate/'+data.devicetemplate.TemplateID+'/powerport/'+(parseInt(i)+1),async: false,data: row.data("globalpowerports")[i]}).always(function(data){});
}

// Create slots
for(var i in row.data("globalslots")){
$.ajax({type: postorput,url: 'api/v1/devicetemplate/'+data.devicetemplate.TemplateID+'/slot/'+(parseInt(i)+1),async: false,data: row.data("globalslots")[i]}).complete(function(data){});
$.ajax({type: postorput,url: 'api/v1/devicetemplate/'+data.devicetemplate.TemplateID+'/slot/'+(parseInt(i)+1),async: false,data: row.data("globalslots")[i]}).always(function(data){});
}
}else{
row.removeClass('change');
Expand Down

0 comments on commit 5a783a2

Please sign in to comment.