本文介绍了SharePoint Apps for SharePoint Online的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我创建了一个应用来获取当前用户的列表项。它在桌面浏览器/ Android上工作正常,但在iPhone上显示错误。它说"来自服务器的意外响应"。当用户点击OK按钮这个错误警告窗口时,其他部分
的应用程序按需运行。

I have created one app to get list items for current user. It is working fine on desktop browser/Android but displaying error on iPhone. It says "Unexpected response from the server." While user click OK button this error alert window, other parts of app working as required.

这是我的代码

<script type="text/javascript">
        'use strict';

        var web;
        var user;
        var spHostUrl;
        var parentContext
        var userEmail;
        var context = SP.ClientContext.get_current();
        var user = context.get_web().get_currentUser();
        var collListItemOption = null;
        var collListItemPage = null;
        var itemId = null;
        var redirectStatus = false;




        $(document).ready(function () {
            getUserName();
        });



        // This function prepares, loads, and then executes a SharePoint query to get the current users information
        function getUserName() {
            context.load(user);
            context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);
        }

        // This function is executed if the above call is successful
        // It replaces the contents of the 'message' element with the user name
        function onGetUserNameSuccess() {
            userEmail = user.get_email();
            alert(userEmail);This part works after onGetUserNameFail in iPhone in other browsers/devices it is working fine
        }

        // This function is executed if the above call fails
        function onGetUserNameFail(sender, args) {
            alert('Failed to get user email. Error:' + args.get_message());

//
        }




    </script>

Satyam MCITP,MCPD

Satyam MCITP, MCPD

推荐答案

我在iphone设备上测试了一个简单的应用程序,但我没有遇到这样的错误。

请创建一个简单的应用程序,以便再次测试以缩小问题范围。

还请在您的iphone中查看您的IOS版本和浏览器版本,安装最新更新并再次测试。

最好的问候,


这篇关于SharePoint Apps for SharePoint Online的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 02:06
查看更多