0

我编写了一个正确加载的函数(请参阅顶部的 hokey 警报),该函数继续调用 SP.SOD.executeFunc 以检查设备是否为 ipad,然后调用 SetFullScreenMode(true);

window.onload = function () {

alert('has loaded');
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', goToFullScreen);

function goToFullScreen() {
    alert('never gets called on an iPad'); // doesn't matter if isiPad is correct, this should at least happen
    var isiPad = navigator.userAgent.indexOf('iPad') != -1;
    if(isiPad) {
        SetFullScreenMode(true);
    }
}
};

它在 Chrome 和 IE8 中运行良好,但在 iPad 中不起作用,因此 executeFunc 有任何特定的浏览器要求。出现“已加载”消息,但没有执行任何其他操作。

有什么建议么?

4

1 回答 1

0

似乎脚本未执行的问题是我的错,我需要提示脚本通知待处理的函数。不清楚为什么这不适用于 iPad,但你去吧。

有关信息,有效的脚本是;

window.onload = function () {


SP.SOD.executeOrDelayUntilScriptLoaded(goToFullScreen, 'sp.js');
function goToFullScreen() {

    var isiPad = navigator.userAgent.indexOf('iPad') != -1;
    if(isiPad) {
        SetFullScreenMode(true);
    }
}
SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs("sp.js");
};
于 2013-10-19T08:27:43.770 回答