function printAttachments(urls)
{
if (urls.length > 0) {
for (var i = 0; i < urls.length; i++) {
var fileName = urls[i].split('/');
var files=$("#FileAttachments").append('
' + fileName[fileName.length - 1] + '');
};
}
else {
$("#fileContainer").hide();
}
}
function getAttachmentFiles(listName, listItemId, complete) {
$().SPServices({
operation: "GetAttachmentCollection",
async: false,
listName: listName,
ID: listItemId,
completefunc: function (xData, Status) {
var attachmentFileUrls = [];
$(xData.responseXML).find("Attachment").each(function () {
var url = $(this).text();
attachmentFileUrls.push(url);
});
complete(attachmentFileUrls);
}
});
}