我从事的项目需要我从 SharePoint 2013 列表中提取数据并将该数据显示到 html 表中。正在查询和显示所有数据,但是两个查找列显示“ID;#”。如何从值的前面删除它,并只显示值?
function get() {
var method = "GetListItems";
var webURL = $().SPServices.SPGetCurrentSite();
var list = "QA_DailyStatus";
var fieldsToRead = "<ViewFields>" + "<FieldRef Name='ProjectRelease' />" + "<FieldRef Name='StastusDate' />" + "<FieldRef Name='ProductionReleaseDate' />" + "<FieldRef Name='Overall_QA_Status' />" + "<FieldRef Name='Overall_QA_Percent_Complete' />" + "</ViewFields>";
var query = "<Query><Where><Eq><FieldRef Name='Active_DSR' /><Value Type=\"bit\">1</Value></Eq></Where></Query>";
$().SPServices
({
operation: method,
async: false,
webURL: webURL,
listName: list,
CAMLViewFields: "<ViewFields Properties='True' />",
CAMLQuery: query,
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
var Release = $(this).attr("ows_ProjectRelease");
var StatusDate = $(this).attr("ows_StastusDate");
var ProductionDate = $(this).attr("ows_ProductionReleaseDate");
var OverallStatus = $(this).attr("ows_Overall_QA_Status");
var PercentComplete = $(this).attr("ows_Overall_QA_Percent_Complete");
$("#myDataTable").append("<tr align='middle'>" +
"<td align='left'>" + Release + "</td>" +
"<td align='left'>" + StatusDate + "</td>" +
"<td align='left'>" + ProductionDate + "</td>" +
"<td align='left'>" + OverallStatus + "</td>" +
"<td align='left'>" + PercentComplete + "</td>" + "</tr>");
});
}
});
};