简体   繁体   English

使用JavaScript从Sharepoint 2013获取列表数据

[英]Getting List data from Sharepoint 2013 using javascript

I got a sharepoint 2013 with some data in a list like below 我有一个共享点2013,其中的一些数据如下表所示

Ex : 例如:

Name | 姓名| Employeetype| 员工类型| -------|-------------| ------- | ------------- || John | 约翰| Permanent | 永久| David | 大卫| Temporary | 临时|

Now i need to display this data in a html table using javascript. 现在,我需要使用javascript在html表中显示此数据。

I got some code , but i dont know how to use that code. 我有一些代码,但我不知道如何使用该代码。 below is the code i got so far 下面是我到目前为止的代码

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.SPServices-0.5.6.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    webURL: "http://siteurl/Lists/test/AllItems.aspx",
    async: false,
    listName: "test",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
        alert(liHtml);
        $("#tasksUL").append(liHtml);
      });
    }
  });
});

Can anybody help on this. 有人可以帮忙吗?

Help is very much appreciated. 非常感谢您的帮助。

You can Javascript client object model to perform basic tasks in sharepoint. 您可以使用Javascript客户端对象模型在sharepoint中执行基本任务。

You can check the following link for more details: 您可以检查以下链接以获取更多详细信息:

http://msdn.microsoft.com/en-us/library/office/jj163201(v=office.15).aspx http://msdn.microsoft.com/zh-CN/library/office/jj163201(v=office.15).aspx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在SharePoint 2013中使用JavaScript - Using javascript in sharepoint 2013 使用JavaScript和jQuery获取超链接字段/列以从SharePoint列表中将数据显示为超链接 - Getting a hyperlink field/column to display data as a hyperlink from a SharePoint List, using JavaScript and jQuery 如何使用JQuery或JavaScript和Fill DropDownList检索sharepoint 2013列表数据? - How to retrieve sharepoint 2013 list data using JQuery or JavaScript and Fill DropDownList? Sharepoint 2013将查找值添加到另一个列表Java列表中 - Sharepoint 2013 Add lookup value to list from another list Javascript 当前用户使用SharePoint 2013上的JavaScript从列表筛选器中检索元素 - Retrieve elements from a list filter by Current User using JavaScript on SharePoint 2013 使用 JavaScript 限制可在 SharePoint 2013 列表中输入的项目数 - Limit the number of items that can be entered in a SharePoint 2013 List using JavaScript 通过Apache Web服务器上的Javascript创建Sharepoint 2013列表项 - Creating Sharepoint 2013 List Items via Javascript from Apache webserver 使用 Jquery 从 SharePoint 2010 站点获取列表数据 - Getting list data from SharePoint 2010 site using Jquery 使用服务调用从共享点列表数据中获取数据并显示在html表中,一切正常,但一个javascript失败 - Using service call getting data from sharepoint list data and displaying in html table, everything is working but one javascript is failing 通过JavaScript在Office 365上使用REST远程访问Sharepoint 2013 - Remotely accessing Sharepoint 2013 using REST on Office 365 from JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM