This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*============================================================================*/ | |
/* 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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//================================================================== | |
// 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); | |
}); |
NewerOlder