0

我在共享点页面上的应用程序部分单击按钮时调用下面的函数“对话框”,但出现访问被拒绝错误可能是由于 iframe 的 DOM 访问限制。是否有任何方法或其他方法可以从应用程序部分打开共享点页面。 function Dialog() {

hostweburl =
     decodeURIComponent(
         getQueryStringParameter('SPHostUrl')
 );
appweburl =
    decodeURIComponent(
        getQueryStringParameter('SPAppWebUrl')
 );
//alert(hostweburl);
//alert(appweburl);
var scriptbase = hostweburl + '/_layouts/15/';

$.getScript(scriptbase + 'SP.Runtime.js',
    function () {
        $.getScript(scriptbase + 'SP.js',
            function () { $.getScript(scriptbase + 'SP.RequestExecutor.js', ShowServerInformation); }
        );
    }
);

}

function ShowServerInformation() {

var options = {
    url:  "/_layouts/Viewlsts.aspx&IsDlg=1",
    tite: 'Server Information',
    allowMaximize: false,
    showClose: true,
    width: 430,
    height: 230
};
parent.SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
return false;

}

4

1 回答 1

0

尝试为应用程序授予适当的应用程序权限。

<AppPermissionRequests>
  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests>

更多信息在这里:http: //msdn.microsoft.com/en-us/library/office/fp142383.aspx

于 2013-11-12T22:08:02.547 回答