[英]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.