-
StackOverflow 文档
-
sharepoint 教程
-
使用 JavaScript 的模态对话框
-
显示自定义对话框
SP.SOD.executeOrDelayUntilScriptLoaded(showDialog,"sp.js");
function showDialog(){
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.title = "Your Title Here!";
var dummyElement = document.createElement("div");
dummyElement.style.textAlign = "center";
dummyElement.appendChild(document.createElement("br"));
dummyElement.appendChild(document.createTextNode("Some beautifully crafted text."));
dummyElement.appendChild(document.createElement("br"));
dialogOptions.html = dummyElement;
SP.UI.ModalDialog.showModalDialog(dialogOptions);
}