html頁面如何變成jsp頁面,如何和後臺對接
阿新 • • 發佈:2019-01-06
/* 點選檢視顯示詳情 */
$('.see').toggle(function() {
$(this).parents("li").css("background", "#fff");
$(this).parents("li").find(".detail").show();
},
function() {
$(this).parents("li").css("background", "#ededed");
$(this).parents("li" ).find(".detail").hide();
})
/* 點選刪除刪除廣告 */
$('.del').click(function() {
const self = this;
//詢問框
layer.confirm('您是如何確定刪除?', {
btn: ['確認','取消'] //按鈕
},function(index){
var adverId = $(this).parents("li" ).find(".adverID").text();
var machineId = '${machine.id }';
console.log(adverId);
$.ajax({
type : "post",
url : "/adver/deleteAdverByMachine.ihtml",
data : {
"adverId" : adverId,
"machineId": machineId
},
async : false,
success : function(data) {
$(self).parents("li").remove();
},
error:function(){
alert("刪除失敗");
}
})
layer.close(index);
},function(){
});
})
/* 點選刪除刪除模板 */
$('.moudledel').click(function() {
const self = this;
//詢問框
layer.confirm('您是如何確定刪除?', {
btn: ['確認','取消'] //按鈕
},function(index){
var adverId = $(this).parents("li").find(".adverID").text();
var machineId = '${machine.id }';
var templateId = $(this).parents("li.module").find("span.moduleId").text();
$.ajax({
type : "post",
url : "/adver/deleteAdverByMachine.ihtml",
data : {
"adverId" : adverId,
"machineId": machineId,
'templateId': templateId
},
async : false,
success : function(data) {
$(self).parents("li.module").remove();
},
error:function(){
alert("刪除失敗");
}
})
layer.close(index);
},function(){
});
})