我使用上刪除通話如何在此腳本的isconfirm方法中調用URL?
<input type='button' value='Delete' class='btn btn-danger btn-sm'
id='btn_Delete6' profile-id='#= ProfileID#'>
,這是它的運行
$(document).ready(function() {
$('body').on('click', 'td input', function() {
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonClass: 'btn-danger',
confirmButtonText: 'Yes, delete it!',
cancelButtonText: "No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false
},
function (isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
});
})
問題腳本一個onclick的是,我不知道如何獲得url期間運行isConfirm函數。我將該行的profileID傳遞給profile-id
的url。我怎樣才能撥打我需要的/OBProfile/Delete/"profileid"
?這是通過使用SweetAlert
可以使用$。員額和編制網址。 – ashokd
「profile-id」屬性是什麼?你通常會如何閱讀這些信息? – Jamiec
這是[答案](http://stackoverflow.com/a/31519928/572827)針對您之前詢問過的相同問題。 – lshettyl