The basic use of layer pop-up window

Open popup

function showCus(cus) {
layer.open({
type : 2,
title : ' ',
maxmin : true,
shadeClose : true, //click the mask to close the layer
closeBtn : 1,
area : [ '600px', '400px' ] ,
content : '${ctx}/psi/money/showCus?cus=' + cus
});
}

close popup

function sub() {
var fmr = $("#fm").serialize();
var skmoney = $("#skmoney").val();
$.ajax({
async:true,
url:"${ctx }/psi/money/receivablesById",
data:$("#fm").serialize(),
type:"POST",
success:function(data){
if(data){
var index=parent.layer.getFrameIndex( window.name);
parent.layer.close(index); //When the pop-up window is a new page
window.parent.location.reload();//Refresh the parent page
}else{
var index=parent.layer.getFrameIndex (window.name);
parent.layer.close(index); //When the popup window is a new page
window.parent.location.reload();//Refresh the parent page
}
},
error:function(){
alert ("Failed to collect payment!!!")
var index=parent.layer.getFrameIndex(window.name);
parent.layer.close(index); //When the pop-up window is a new page
window.parent.location.reload();//Refresh the parent page
},
dataType:"json"
});
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325340745&siteId=291194637