1.2.1 • Published 6 years ago

spcrossdomainajax v1.2.1

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

DOI Logo #SPCrossDomainAJAX

SPCrossDomainAJAX is a convenience wrapper for SharePoint's built in AJAX API. This package is built for use in SharePoint 2016 and SharePoint Online. Cross Domain AJAX Requests are implemented using the generic interface ISPCrossDomainAJAX<T, K> T is the data type of the data to be passed in the request body. K is the data type of the data to be returned in the promise from Execute.

SPCrossDomainAJAX<T, K>

#Usage

    import {ISPCrossDomainAJAX, SPCrossDomainAJAX, ISPCrossDomainAJAXRequest, ISPCrossDomainAJAXRequestError} from "SPCrossDomainAJAX";
    // Add some code to load SP.Runtime.js, SP.js, and SP.RequestExecutor.js
    // T parameter is irrelevant for GET which is the default operation
    const crossDomainHelper:ISPCrossDomainAJAX<void, listInterface> = new SPCrossDomainAJAX<void, listInterface>();
    crossDomainHelper.Execute({ Method: HTTPMethod.GET;
    RequestUrl: "/_api/web/lists(guid'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')/Items"
    WebUrl: "/"}).then((value:listInterface)=>console.log("success!")).catch((reason: ISPCrossDomainAJAXRequestError) => console.log("Failed with status text: " +reason.statusText));

Office of Chief Information Officer

1.2.1

6 years ago

1.2.0

6 years ago

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago