onLoad之类的事件如何能统一重载

提问 已结 1 4579
悬赏:20飞吻
请问下,现在像这种情况
$myDialog.iDialog({
id: 'myDialog',// 唯一标识id
title: _title,// 标题
closed: false, // 关闭状态
cache: false,
height: 450, // 高度
width: 780, // 宽度,
method:'get',
href: _url, // 加载页面元素的地址
model:true,
buttons: [
{text: '保存', iconCls: 'fa fa-plus', btnCls: 'topjui-btn-green'},
{text: '关闭', iconCls: 'fa fa-no', btnCls: 'topjui-btn-red'}
],
onLoad: function (data) {
if (JSON.parse(data).status === -1000) window.location.reload(true);
}
});
我期望对于每一处创建iDialog,都自动在onLoad里面有里面那行代码的话,有什么好的办法,还是我必须每写一处都像这样自己加上吗?
回帖
回帖须知