function xqxxForm(wid) { var isFrameSaved = false; var url = "iframe:${ctx}/yggl/ygscxx/getYgsjd?wid=" + emptyHandle(wid) + "&sgid=${ygglYgscxx.sgid}&sqid=${ygglYgscxx.wid}&callType=1"; var t = "实际义工时长"; top.$.jBox.open(url, t, 700, 600, { buttons: {"确定": "ok", "关闭": true}, bottomText: "", submit: function (v, h, f) { if (v == "ok") { //保存信息 h.find("iframe")[0].contentWindow.save(); isFrameSaved = true; return false; $(".jbox-content", top.document).css("overflow-y", "hidden"); window.parent.location.reload(); } }, closed: function () { if (isFrameSaved) { showXqxx(); } }, loaded: function (h) { $(".jbox-content", top.document).css("overflow-y", "hidden"); } }); }保存后关闭子页面
时间: 2024-02-10 10:08:16 浏览: 66
您的代码逻辑有误,因为 `return false;` 会导致 `$(".jbox-content", top.document).css("overflow-y", "hidden");` 和 `window.parent.location.reload();` 这两行代码无法执行。应该将这两行代码放在 `return false;` 之前。修改后的代码如下:
```
function xqxxForm(wid) {
var isFrameSaved = false;
var url = "iframe:${ctx}/yggl/ygscxx/getYgsjd?wid=" + emptyHandle(wid) + "&sgid=${ygglYgscxx.sgid}&sqid=${ygglYgscxx.wid}&callType=1";
var t = "实际义工时长";
top.$.jBox.open(url, t, 700, 600, {
buttons: {"确定": "ok", "关闭": true},
bottomText: "",
submit: function (v, h, f) {
if (v == "ok") {
// 保存信息
h.find("iframe")[0].contentWindow.save();
isFrameSaved = true;
$(".jbox-content", top.document).css("overflow-y", "hidden");
window.parent.location.reload();
return false;
}
},
closed: function () {
if (isFrameSaved) {
showXqxx();
}
},
loaded: function (h) {
$(".jbox-content", top.document).css("overflow-y", "hidden");
}
});
}
```
阅读全文