SharePoint Ajax调用列表 [英] SharePoint Ajax call to List

查看:91
本文介绍了SharePoint Ajax调用列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

向SharePoint列表2013发出ajax请求时,出现连接超时504错误.它工作正常,突然停止工作.您能建议我如何解决它吗?

Am getting connection time out 504 error when making ajax request to SharePoint list 2013. It was working fine, it stops working suddenly. Can you please suggest how can I fix it.

var item = {
                      标题":"Shared",         
           'ProjectIDId':projectID,
           'SharedEmailRemarks':txtSharedRemarks,
           'SharedCorpEmailToId':{'结果':allUserIds},
                                       'DocsInfo':docInfo
       };
       $ .ajax({
           url:_spPageContextInfo.webAbsoluteUrl +``/_api/lists/GetByTitle('''+ listname +``')/items',
          类型:"POST",
           contentType:"application/json; odata = verbose",
          数据:JSON.stringify(item),
          标头:{
                             "Accept":"application/json; odata = verbose",
                             "X-RequestDigest":$("#__ REQUESTDIGEST").val()
           },
          成功:功能(数据){
                             //alert("Alert将很快发送.");
                             $(#msgEmailSuccess").show();
                             $(#btnSendSharedDocs").attr('disabled',true);
                             $ .when(KickOffDetailsS​​ubmit("SharedClosed","next"))).done(function(p1){
                             });   
   },
          错误:函数(错误){
                             alert(JSON.stringify(error));
           }
       });

var item = {
            "__metadata": { "type": getListItemType(listname) },
            'Title': "Shared",           
            'ProjectIDId': projectID,
            'SharedEmailRemarks': txtSharedRemarks,
            'SharedCorpEmailToId': { 'results': allUserIds },
             'DocsInfo':docInfo
        };
        $.ajax({
            url: _spPageContextInfo.webAbsoluteUrl + "/_api/lists/GetByTitle('" + listname+ "')/items",
            type: "POST",
            contentType: "application/json;odata=verbose",
            data: JSON.stringify(item),
            headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
            },
            success: function (data) {
                //alert("Alert will be sent shortly.");
                $("#msgEmailSuccess").show();
                $("#btnSendSharedDocs").attr('disabled', true);
                $.when(KickOffDetailsSubmit("SharedClosed", "next")).done(function (p1) {
                });   
    },
            error: function (error) {
                alert(JSON.stringify(error));
            }
        });

推荐答案

504是网络问题.

您要更新SharePoint环境还是可以检查网络以查看它是否正常?

Do you update the SharePoint environment or can you check the network to see whether it is fine?


这篇关于SharePoint Ajax调用列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆