我正在尝试使用删除功能从用户的 soundcloud 帐户中删除曲目,同时也从我的数据库中删除曲目。它成功地从我的数据库中删除了信息,但没有从 soundcloud 的数据库中删除,我真的不明白为什么!直到最后都没有出现错误,只是不会从 soundcloud 中删除曲目。
这是我正在使用的代码:
$(".deleteTrack").live("click", function () {
if (SC.isConnected) {
var scTid = $(this).attr('id');
var path = "/tracks/" + scTid;
var con = confirm("Are you sure you want to delete this track?");
if (con) {
$.ajax({
type: "POST",
contentType: "application/json",
url: "JamWithInI.aspx/GetTrackInfo",
data: "{'scTid':'" + scTid + "'}",
dataType: "json",
success: function(str){
inst = str.d["1"];
SC.delete(path, function(){
$.ajax({
type: "POST",
contentType: "application/json",
url: "JamWithInI.aspx/DeleteTrack",
data: "{'scTid':'" + scTid + "'}",
dataType: "json",
success: function(){
alert("Your track has been deleted");
$("#openInstruments").trigger('click').trigger('click');
$(".instrument").trigger('click').bind('click').trigger('click');
inst = null;
},
error: function () {
alert("Track did not delete succesfully");
}
});
});
},
error: function () {
alert("An error occurred");
}
});
}
}
});