office365 sharepoint2013 online 环境:使用Jquery 读取list 并把list数据快速插入HTML table(其他数据格式同理)
这么早写这篇记录,仅记录自己昨天夜里做的一个小功能。从sharepoint2013 list读取数据动态追加到 页面 table里。
js代码
//***************************Modify 2014-05-19 author dct **************************************
//Get the AICDocApprovalWFList Data
function GetHeaderData()
{
var siteUrl =<a target=_blank target="_blank" href="https://xxxx.sharepoint.com/xxx">https://xxxx.sharepoint.com/xxx</a>;
var projectList="projectList";
$.ajax({
url: siteUrl + "/_api/web/lists/getbytitle('" + projectList + "')/items",
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
},
success: function (data) {
//complete(data); // Returns JSON collection of the result