• SharePoint 2013


    用于在SharePoint中调用其它网站服务时使用。

    1. 需要引用sp.js 和 sp.runtime.js文件;

    2. 需要用到SP.WebRequestInfo,SP.WebProxy,和SP.WebReponseInfo对象;

    3. 例子:

    (function () {
        // Prepare the request to an RSS source
        //  using the GET verb
        var context = SP.ClientContext.get_current();
        var request = new SP.WebRequestInfo();
        request.set_url(
            "http://www.microsoft.com/en-us/news/rss/rssfeed.aspx?ContentType=FeatureStories"
            );
        request.set_method("GET");
        var response = SP.WebProxy.invoke(context, request); //response is type of SP.WebResponseInfo
    
        // Let users know that there is some
        //  processing going on
        document.getElementById("stories").innerHTML =
                    "<P>Loading stories...</P>";
    
        // Set the event handlers and invoke the request
        context.executeQueryAsync(Function.createDelegate(this, successHandler), Function.createDelegate(this, errorHandler));
    })();
  • 相关阅读:
    Beetl模板 [记录]
    wx 小程序开发 [记录]
    高德定位获取省市区[记录]
    vue 学习记录 [记录]
    正则表达+验证 [记录]
    倒计时60s短信 [记录]
    @media [记录]
    JSON + Ajax [记录]
    Webstorm [记录]
    JQ 组合代码 [记录]
  • 原文地址:https://www.cnblogs.com/qijiage/p/3927029.html
Copyright © 2020-2023  润新知