0
我使用SPServices得到一些數據從一個列表,像這樣:我需要幫助建立HTML表格與SP服務(jQuery的)
listSiteTabURLSalesTool = 'http://myServer';
$().SPServices({
operation: "GetListItems",
webURL: listSiteTabURL,
listName: 'Follow',
async: false,
CAMLQuery:"<Query><Where><Eq><FieldRef Name='Location'/><Value Type='Text'>" + store + "</Value></Eq></Where></Query>",
CAMLViewFields:"<ViewFields><FieldRef Name='Title'/><FieldRef Name='Location'/></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).find("[nodeName='z:row']").each(function() {
var title = $(this).attr("ows_Title");
var store = $(this).attr("ows_Location");
var data = title + "-" + store;
});
$("#idfollowup").append(data);
}
});
,但我想建立這個表來使用它與數據表插件:
<div id="idfollowup">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example" width="100%">
<thead>
<tr>
<th>Titlee</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<tr>
<td>Title</td>
<td>Location</td>
</tr>
</tbody>
</table>
</div>
任何幫助,將不勝感激。
感謝