Skip to content

Instantly share code, notes, and snippets.

View stevenfollis's full-sized avatar

Steven Follis stevenfollis

View GitHub Profile
@stevenfollis
stevenfollis / SP2013-REST-Operations
Last active January 4, 2016 18:28
Snippets of jQuery/JavaScript for doing cool stuff with REST services in SharePoint 2013
/*============================================================================*/
/* Query an external endpoint via REST */
function queryEndpoint(url, callback) {
// Issue a POST request to the SP.WebProxy.Invoke endpoint.
// The body has the information to issue a GET request
$.ajax({
url: "../_api/SP.WebProxy.invoke",
type: "POST",
@stevenfollis
stevenfollis / SP2010-REST-Operations-jQuery
Last active January 4, 2016 08:49
SharePoint 2010 REST Endpoint Operations using jQuery
//==================================================================
// Get list items
// define the target list url
var listUrl = 'http://samplesite/_vti_bin/ListData.svc/Employee';
$.getJSON(listUrl, function(data) {
// loop through the result set
$.each(data.d.results, function(i, result) {
alert(result);
});