弹出脚本问题 [英] Popup Script Issue
问题描述
您好
我们在弹出功能的母版页中包含自定义脚本,
代码: -
var gResultURL ="" ;;   // ==用于在用户提交投票后显示结果
函数popupPoll(pollURL,resultURL,title){
gResultURL = resultURL;
openDialog(pollURL,title); < br $>
}
函数openDialog(url,title) {
var options = new Object;
options.url = url;
$
options.width = 650;
options.height = 300;
options.title = title;
options.dialogReturnValueCallback = Function.createDelegate(null,CloseCallback);
SP.SOD.execute('sp.ui.dialog.js','SP.UI.ModalDialog.showModalDialog',options);
}
var showDialog = SP.UI.ModalDialog。 showModalDialog;
$
SP.UI.ModalDialog.showModalDialog = function(options){
&NBSP; var defd;
&NBSP;试试{
&NBSP; &NBSP; defd = typeof(SP.UI.ModalDialog.showModalDialog);
&NBSP; } catch(e){
&NBSP; &NBSP; &NBSP; defd =" undefined"
&NBSP; }¥b $ b &NBSP; EnsureScript(" SP.UI.Dialog.js",defd,function(){showDialog(options);});
};
¥ b $ b函数CloseCallback(result,returnValue){
if(result === SP) .UI.DialogResult.OK)
{
if(gResultURL!=""){
openDialog(gResultURL,'Results');
}
}
else if(result == SP.UI.DialogResult.cancel)
{
gResultURL!="" ;;
}
}
这是阻止页面 Ch eck In / Publish 弹出编辑模式 直接
限制
编辑模式中的签入/发布功能。请查看代码并告知我们应该实施哪些更改。所以它不会影响任何弹出功能,并且可以毫无问题地工作。
[SharePoint Online] [母版页]
您好,
请删除代码中的代码段。
var showDialog = SP.UI.ModalDialog.showModalDialog;
SP.UI.ModalDialog.showModalDialog = function(options){
var defd;
try {
defd = typeof(SP.UI.ModalDialog.showModalDialog);
} catch(e){
defd =" undefined"
}
EnsureScript(" SP.UI.Dialog.js",defd,function(){showDialog(options);});
};最好的问候,
Dennis
Hi
We have custom script included in master page for popup functionality,
Code:-
var gResultURL = ""; //== used to show the results after user submitted a poll
function popupPoll(pollURL, resultURL, title) {
gResultURL = resultURL;
openDialog(pollURL, title);
}
function openDialog(url, title) {
var options = new Object;
options.url = url;
options.width = 650;
options.height = 300;
options.title = title;
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
var showDialog = SP.UI.ModalDialog.showModalDialog;
SP.UI.ModalDialog.showModalDialog = function(options) {
var defd;
try {
defd = typeof (SP.UI.ModalDialog.showModalDialog);
} catch (e) {
defd = "undefined"
}
EnsureScript("SP.UI.Dialog.js", defd, function () { showDialog(options); });
};
function CloseCallback(result, returnValue){
if(result === SP.UI.DialogResult.OK)
{
if(gResultURL!="") {
openDialog(gResultURL, 'Results');
}
}
else if (result == SP.UI.DialogResult.cancel)
{
gResultURL!="";
}
}
It is blocking page Check In/Publish popup in Edit Mode which directly restricting both Check In/Publish functionality in Edit Mode. please look into code and advise what changes should we implement. So it won't affect any popup functionality and will work without any issue.
[SharePoint Online][Master Page]
Hi,
Please remove the code snippet below in your code.
var showDialog = SP.UI.ModalDialog.showModalDialog; SP.UI.ModalDialog.showModalDialog = function(options) { var defd; try { defd = typeof (SP.UI.ModalDialog.showModalDialog); } catch (e) { defd = "undefined" } EnsureScript("SP.UI.Dialog.js", defd, function () { showDialog(options); }); };Best Regards,
Dennis
这篇关于弹出脚本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!