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的更多相关文章

  1. SharePoint 2013 - REST Service

    0. SharePoint 2013使用_api来标识出 REST SERVICE,REST Service其实是 client.svc web service的一部分,但为了简化 REST URI的 ...

  2. SharePoint 2013 安装 Service Pack 1

    Problem 当迁移SharePoint 的时候,执行Move-SPSite 命令,将指定的Site Collection移动到目标内容数据库中时,提示以下错误:Cannot complete th ...

  3. SharePoint REST api

    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx Understanding and Using the SharePoint 2013 R ...

  4. 修复SharePoint 2013 Search 拓扑错误

    Problem 当创建和配置SharePoint 2013 Search Service Application成功之后,进入详细配置页后,在Search Application Topology节点 ...

  5. SharePoint 2013中的爬网最佳做法

    了解在 SharePoint Server 2013 中爬网的最佳做法 搜索系统对内容进行爬网,以构建一个用户可以对其运行搜索查询的搜索索引.本文包含有关如何最有效地管理爬网的建议. 本文内容: 使用 ...

  6. SharePoint 2013 APP 开发示例 (六)服务端跨域访问 Web Service (REST API)

    上个示例(SharePoint 2013 APP 开发示例 (五)跨域访问 Web Service (REST API))是基于JavaScript,运行在web browser内去访问REST AP ...

  7. SharePoint 2013 APP 开发示例 (五)跨域访问 Web Service (REST API)

          虽然 JQuery 也能通过授权header实现跨域, 但SharePoint 提供了更简单的方法,它被实现在SP.RequestExecutor里 .它能访问跨域的服务包括REST AP ...

  8. SharePoint 2013 Search REST API 使用示例

    前言:在SharePoint2013中,提供Search REST service搜索服务,你可以在自己的客户端搜索方法或者移动应用程序中使用,该服务支持REST web request.你可以使用K ...

  9. 在 SharePoint 2013 中选择正确的 API 集

    决定使用哪个 API 集的因素   您可以在多个 API 集中选择一个来访问 SharePoint 2013 平台.您使用哪一个 API 集取决于以下因素: 应用程序的类型. 可能的类型包括但不限于以 ...

随机推荐

  1. WinServer2008r2 机器时间格式修改

    windows2008 这么高级的系统不可能改个系统的日期时间显示格式还要进注册表啊.于是有baidu,google了下终于发现了,原来还有不需要注册表的更简便方法.windows2008默认时间格式 ...

  2. Android IOS WebRTC 音视频开发总结(七四)-- WebRTC开源5周年了,Google怎么看?

    本文最早发表在我们的微信公众号上(微信ID:blackerteam),支持原创,详见这里, 2016年6月9日是WebRTC开源5周年的日子,Google WebRTC负责人Harald在社区里面写了 ...

  3. idea 到myeclipse

    在上一篇博客使用maven进行开发过程管理之准备篇中提到了maven的基本概念.IT男罗书全觉得概念我是懂了,但是那些东西似乎离我很远啊.先开发再说吧, 于是IT男罗书全就在svn上取了源代码,并开始 ...

  4. redis:hash 数据类型

    简介 Redis Hashes是字符串字段和字符串值之间的映射,所以它们是完美的表示对象(eg:一个有名,姓,年龄等属性的用户)的数据类型.新建一个hash对象时开始是用zipmap(又称为small ...

  5. jQuery Mobile 脚本加载问题

    刚开始使用jQuery Mobile,发现很多问题需要重新考虑,比如脚本加载问题. 在普通html中,如果a.html中有链接到b.html,b.html中有类似代码: $(document).rea ...

  6. TestLink安装全攻略

    TestLink安装全攻略 此文章转自该链接--http://www.cnblogs.com/Tcorner/archive/2011/07/26/2117296.html 安装前准备 需要下载xam ...

  7. MVC学习(四)几种分页的实现(2)

    在第一种分页方式中,仅仅实现了分页,但并未有体现出MVC的优势,没有体现出泛型编程思想,尤其在数据量很大的时候,分页十分缓慢,除此之外,还没有实现很好的封装,不是一个通用方法. 因此,我希望只要传入数 ...

  8. linux学习之——数据操作:添加与查询

    说明: 在linux系统中,利用搭建的服务器,编写两个页面,一个添加信息,一个展现信息: 主要涉及到:php+mysql的操作: 数据添加页面: <html> <head> & ...

  9. centos6.5搭建lnmp环境

    注:本文原文链接:http://www.cnblogs.com/xiaoit/p/3991037.html 本文只是做保存使用 1:查看环境: [root@10-4-14-168 html]# cat ...

  10. oracle系统表查询

    oracle查询用户下的所有表 select * from all_tab_comments -- 查询所有用户的表,视图等select * from user_tab_comments -- 查询本 ...