sharepoint 弹出
代码
function myCallback(dialogResult, returnValue) {
alert(returnValue.toString())
}
function showDialog() {
var options = {
url: 'http://....../SitePages/PopUpWindow.aspx',
width: 700,
title: 'PopUp',
allowMaximize: true,
showClose: true,
dialogReturnValueCallback: myCallback
}
SP.UI.ModalDialog.showModalDialog(options);
}
alert(returnValue.toString())
}
function showDialog() {
var options = {
url: 'http://....../SitePages/PopUpWindow.aspx',
width: 700,
title: 'PopUp',
allowMaximize: true,
showClose: true,
dialogReturnValueCallback: myCallback
}
SP.UI.ModalDialog.showModalDialog(options);
}
弹出框页面代码(传输参数:123):
<a href="javascript:window.frameElement.commonModalDialogClose(1,'123')">
commonModalDialogClose(1,'myReturnValue')</a><br />
commonModalDialogClose(1,'myReturnValue')</a><br />
本页div弹出:
代码
function openDialog() {
var userStoryDetails;
userStoryDetails = document.getElementById("userStoryDetails");
var options = {
html: userStoryDetails,
width: 600,
height: 300,
title: "User Story",
};
SP.UI.ModalDialog.showModalDialog(options);
}
var userStoryDetails;
userStoryDetails = document.getElementById("userStoryDetails");
var options = {
html: userStoryDetails,
width: 600,
height: 300,
title: "User Story",
};
SP.UI.ModalDialog.showModalDialog(options);
}