1,SharePoint中挺简单的一个父页面跳转到子页面的Js代码!常常用到,每次都到以前的项目中去找代码,挺麻烦!
(1)父页面代码。
function imgAddParentclick() {
var projectId = getCookie("projectId");
var options = {
width:800,
height:500,
showClose: true,
url: '/sites/projecttest/Lists/ProjectTasks/search.aspx?projectId=' + projectId,
dialogReturnValueCallback: setmessages
};
SP.UI.ModalDialog.showModalDialog(options);
}
(2)父页面回调函数
function setmessages(dialogResult, returnvalue) { }
(3)子页面代码
function closetaskform(obj) { window.parent.SP.UI.ModalDialog.commonModalDialogClose(, title+'#'+id);
}