I am having trouble getting my contents of the list to populate into a HTML table. I have tried more than one list - I am thinking it could be a server issue on my end, but I need to know - here is the code I created - what am I missing?
<script type="text/javascript" src="jquery-1.9.1.js"></script>
<script type="text/javascript" src="jquery.SPServices-0.7.2.js"></script>
<!--
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:_dlc_DocId msdt:dt="string">34W3AHE3R5JA-134-47</mso:_dlc_DocId>
<mso:_dlc_DocIdItemGuid msdt:dt="string">d08e1aa7-6b50-412a-b7d3-7efb588b7625</mso:_dlc_DocIdItemGuid>
<mso:_dlc_DocIdUrl msdt:dt="string">https://portal.hawcpa.com/training/_layouts/DocIdRedir.aspx?ID=34W3AHE3R5JA-134-47, 34W3AHE3R5JA-134-47</mso:_dlc_DocIdUrl>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>
<body>
<script>
//var htmlTable = '<table>';
$().SPServices({
operation: "GetListItems",
debug: true,
async: false,
listName: "Attributes",
webURL: "http://hawportal/training",
CAMLViewFields: "<ViewFields>" +
"<FieldRef Name='Title' ></FieldRef>" +
//"<FieldRef Name='Competency_x0020_Definition' ></FieldRef>" +
"</ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode('z:row').each(function() {
//htmlTable += "<tr>" +
// "<td>" + $(this).attr("ows_Title") + "</td>" +
// "<td>" + $(this).attr("ows_Competency_x0020_Definition") + "</td>" +
//"</tr>";
var comp = ($(this).attr("ows_Title"));
// var def = ($(this).attr("ows_Competency_x0020_Definition"));
})
//htmlTable += "</table>";
//}
}});
function addrowtotable(comp)
{$("htmlTable").append("<tr align='left'><td><a href='" + comp + "'>" + "</a></td></tr>");
}
alert($(this).attr("ows_Title"));
</script>
<div id="htmldiv">
<table id="htmlTable" style="width: 100%">
</table>
</div>
</body>
</html>