I need to get URL's and names of attachments from List and I found such code in SPServices
documentation. I wonder if there is a way to do the same operation for more than one ID
and get separate Div
or li
elements for each ID
:
$().SPServices({
operation: "GetAttachmentCollection",
listName: "MahAwesomeListName",
ID: id,
completefunc: function(xData, Status) {
//console.log( Status );
//console.log( xData.responseText );
var output = "";
//debugger;
$(xData.responseXML).find("Attachments > Attachment").each(function(i, el) {
var $node = $(this),
filePath = $node.text(),
arrString = filePath.split("/"),
fileName = arrString[arrString.length - 1];
output += "<a href='" + filePath + "' target='_blank'>" + fileName + "</a><br />";
});
$("#drop-zone").html(output);
}
});