我是分享点的新手。我想从sharepoint列表中使用javascript和jquery选择数据并在页面上显示。
答案 0 :(得分:3)
Sharepoint 2010使用客户端对象模型
http://www.codeproject.com/Articles/60348/SharePoint-2010-Client-Object-Model-for-JavaScript
Sharepoint 2007使用以下代码
<script language="javascript" type="text/javascript" src="jquery-1.4.3.min.js"> </script>
<script language="javascript" src="jquery.SPServices-0.7.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "[LIST NAME]",
CAMLViewFields: "<ViewFields><FieldRef Name=\"Status\" /><FieldRef Name=\"COLUMN NAME\" /><FieldRef Name=\"COLUMN NAME\" /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
var status = $(this).attr("ows_COLUMN NAME");
var createdDate = $(this).attr("ows_COLUMN NAME");
});
}
});
});
</script>