frameElement.lhgDG
①
var action;
var dg;
$(document).ready(function() {
dg = frameElement.lhgDG;
dg.addBtn('ok','保存',ok);
dg.SetXbtn(closeDialog,false);
dg.SetCancelBtn("取消",closeDialog);
function ok() {
if(checkInfo()){
$.ajax({
type: "POST",
async: false,
url: "<%=request.getContextPath() %>/admin/hotMonthly/save.do",
data: $("#MonthlyMarketForm").serializeArray(),
success: function(msg){
if("add_success" == msg){
//action = "add_success";
dg.cancle();
}
}
});
//$("#MonthlyMarketForm").submit();//ajax提交后已经完成业务,不需要表单提交了(会重复)。
}
}
function closeDialog(){
if(dg){
if(action == "add_success"){
window.parent.location.reload();
}else{
dg.cancel();
}
}
}
});
var dg;
$(document).ready(function() {
dg = frameElement.lhgDG;
dg.addBtn('ok','保存',ok);
dg.SetXbtn(closeDialog,false);
dg.SetCancelBtn("取消",closeDialog);
function ok() {
if(checkInfo()){
$.ajax({
type: "POST",
async: false,
url: "<%=request.getContextPath() %>/admin/hotMonthly/save.do",
data: $("#MonthlyMarketForm").serializeArray(),
success: function(msg){
if("add_success" == msg){
//action = "add_success";
dg.cancle();
}
}
});
//$("#MonthlyMarketForm").submit();//ajax提交后已经完成业务,不需要表单提交了(会重复)。
}
}
function closeDialog(){
if(dg){
if(action == "add_success"){
window.parent.location.reload();
}else{
dg.cancel();
}
}
}
});
②
var action; var dg; $(document).ready(function() { dg = frameElement.lhgDG; dg.addBtn('ok',ok); dg.SetXbtn(closeDialog,false); dg.SetCancelBtn("取消",closeDialog); function ok() { if(checkInfo()){ $("#MonthlyMarketForm").submit();//ajax提交后已经完成业务,不需要表单提交了(会重复)。 } } function closeDialog(){ if(dg){ if(action == "add_success"){ window.parent.location.reload(); }else{ dg.cancel(); } } } });