How to Call SharePoint 2013 API Service to Query The Lists
How to Call SharePoint 2013 API
In SharePoint 2013, we can query the list by it owner service, then dynamic load the info of the list items to render in client.
Here is the require, dynamic load the info about the list named link and show to the page in datail.
Here is my steps:
1. Create a link list named "Links", and create a column named "Category", the column is use for category the links, and filter the items. the add some items.
2. Edit the page that you want to show the Links list items. and add the webpart named Script Edittor to store the js code. then edit the webpart and add the js code into the webpart.
Here is the code:
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
</script>
$(document).ready(function () {
ExecuteOrDelayUntilScriptLoaded(getLinksInfo, "sp.js");
});
function getLinksInfo() { var requestUri = "http://dev-sp"+ "/_api/Web/Lists/getByTitle('Links')/items";
var ulIcons = $("#test"); $.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
success: function (data) { var items = "";
$.each(data.d.results, function (index) {
switch ($(this).attr("Category")) {
case "Operations":
items += "<li><a href='mailto:" + $(this)[0].URL.Url+ "'>" + $(this)[0].URL.Description + " - Operation" + "</a></li>"
break;
case "Marketing":
items += "<li><a href='" + $(this)[0].URL.Url + "'>" + $(this)[0].URL.Description + " - Markrting" + "</a></li>"
break;
} }); if (items != "") {
ulIcons.html("");
ulIcons.html(items);
}
},
error: function (e) {
alert("Failed to get Escalations Icons!");
}
});
} </script>
3. Clicke "Ok" abdou the script webpart and save the page. It wiil show the result
How to Call SharePoint 2013 API Service to Query The Lists的更多相关文章
- SharePoint 2013 - REST Service
0. SharePoint 2013使用_api来标识出 REST SERVICE,REST Service其实是 client.svc web service的一部分,但为了简化 REST URI的 ...
- SharePoint 2013 安装 Service Pack 1
Problem 当迁移SharePoint 的时候,执行Move-SPSite 命令,将指定的Site Collection移动到目标内容数据库中时,提示以下错误:Cannot complete th ...
- SharePoint REST api
http://msdn.microsoft.com/en-us/magazine/dn198245.aspx Understanding and Using the SharePoint 2013 R ...
- 修复SharePoint 2013 Search 拓扑错误
Problem 当创建和配置SharePoint 2013 Search Service Application成功之后,进入详细配置页后,在Search Application Topology节点 ...
- SharePoint 2013中的爬网最佳做法
了解在 SharePoint Server 2013 中爬网的最佳做法 搜索系统对内容进行爬网,以构建一个用户可以对其运行搜索查询的搜索索引.本文包含有关如何最有效地管理爬网的建议. 本文内容: 使用 ...
- SharePoint 2013 APP 开发示例 (六)服务端跨域访问 Web Service (REST API)
上个示例(SharePoint 2013 APP 开发示例 (五)跨域访问 Web Service (REST API))是基于JavaScript,运行在web browser内去访问REST AP ...
- SharePoint 2013 APP 开发示例 (五)跨域访问 Web Service (REST API)
虽然 JQuery 也能通过授权header实现跨域, 但SharePoint 提供了更简单的方法,它被实现在SP.RequestExecutor里 .它能访问跨域的服务包括REST AP ...
- SharePoint 2013 Search REST API 使用示例
前言:在SharePoint2013中,提供Search REST service搜索服务,你可以在自己的客户端搜索方法或者移动应用程序中使用,该服务支持REST web request.你可以使用K ...
- 在 SharePoint 2013 中选择正确的 API 集
决定使用哪个 API 集的因素 您可以在多个 API 集中选择一个来访问 SharePoint 2013 平台.您使用哪一个 API 集取决于以下因素: 应用程序的类型. 可能的类型包括但不限于以 ...
随机推荐
- git 放弃本地修改 强制更新
git reset --hard origin/master
- Timus Online Judge 1001. Reverse Root
Input The input stream contains a set of integer numbers Ai (0 ≤ Ai ≤ 1018). The numbers are separat ...
- 【转】JVM 堆内存设置原理
堆内存设置 原理 JVM堆内存分为2块:Permanent Space 和 Heap Space. Permanent 即 持久代(Permanent Generation),主要存放的是Java类定 ...
- pgadmin中的备份功能消失的原因和找回方法
pgadmin在正常情况下,在左侧的[对象浏览器]中选中数据库.模式或者表时,右键会出现[备份]和[恢复]的选项(除早期不支持该功能的版本外). 如: 当然,有时候有人会发现,当你想要用这些备份还原功 ...
- imp导入oracle的dmp备份数据
imp system/oracle fromuser=lc0029999 touser=lc0029999 rows=y commit=y buffer=65536 feedback=10000 ig ...
- TStringList TMemo Text与Add赋值的区别 Memo.Text赋值高度注意事项,不得不知的技巧。
Memo.Text赋值高度注意事项,不得不知的技巧. list := TStringList.Create; list.Text:= str: list.Count; list.Clear; l ...
- IE8下使用webuploader点击无反应的解决方法。
在IE8开头添加如下代码. <meta http-equiv="X-UA-Compatible" content="IE=edge"> 即可解决,亲 ...
- pcA降维算法
http://ufldl.stanford.edu/wiki/index.php/主成分分析 if ~exist('train_IM_all','var')||~exist('train_LA_all ...
- bs4的学习
soup = BeautifulSoup(html,'html.parser') #'html.parser'是html解析器必须有soup.find_all("a") #等价于 ...
- js 正则 以字母开头必须有 大小写字母数字组成 可以有“@"或 ”.“
js 正则 以字母开头必须有 大小写字母数字组成 可以有“@"或 ”.“ var reg = /^[a-zA-Z]{1}(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d_@ ...