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. Python list 操作

    创建列表sample_list = ['a',1,('a','b')] Python 列表操作sample_list = ['a','b',0,1,3] 得到列表中的某一个值value_start = ...

  2. 洛谷P3383 【模板】线性筛素数

    P3383 [模板]线性筛素数 256通过 579提交 题目提供者HansBug 标签 难度普及- 提交  讨论  题解 最新讨论 Too many or Too few lines 样例解释有问题 ...

  3. 第一波实习的前端笔记(2)——js.md

    1.如何解决移动端点透问题? $('xx').on('touchend', function(event){ event.preventDefault(); }) 但是,存在滑动页面会触发问题.期待更 ...

  4. CSS 块状元素和内联元素的详解

    我们先来分析一下块级元素.内联级元素的定义和解析:  块元素(block element)一般是其他元素的容器元素,块元素一般都从新行开始,它可以容纳内联元素和其他块元素,常见块元素是段落标签'P&q ...

  5. Django自定义分页、bottle、Flask

    一.使用django实现之定义分页 1.自定义分页在django模板语言中,通过a标签实现; 2.前段a标签使用<a href="/user_list/?page=1"> ...

  6. Binary Tree Maximum Path Sum

    Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ...

  7. mybatis(一)环境的搭建

    项目模型: 一.创建一个web项目ssm001 1.1准备数据 在数据创建表并添加数据 user表: dept表: /* Navicat MySQL Data Transfer Source Serv ...

  8. 交换机和VLAN

    交换机 交换机的两个作用:一是维护CAM表,CAM表是计算机的MAC地址和交换机端口的映射表:另一个是根据CAM来进行数据的转发. 以太网交换机转发数据帧有三种方式: 1.存储转发:即先存储后转发的方 ...

  9. 搭建DHCP服务器以及DHCP中继服务器

    一.DHCP服务器   1.首先配置DHCP服务器的IP地址(DHCP服务器网卡桥接在VMnet1)   .配置好IP后重启DHCP服务 3.安装DHCP服务器,在这里我用的是YUM安装的(关于YUM ...

  10. OpenFileDialog - 设置 - Filter 笔记

    using (OpenFileDialog fileSelectDialog = new OpenFileDialog()) { fileSelectDialog.Multiselect = fals ...