How to use jQuery, SharePoint Web Services to add attachment to a List item using shrepoint designer 2010.
I use this code. I struck up where to give local file name. Need Help on this.
<script type="text/javascript">
$(document).ready(function() {
//alert("SAI");
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListCollection xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
</GetListCollection> \
</soapenv:Body> \
</soapenv:Envelope>";
$.ajax({
url: "<<SiteURL>>/TestSite/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
});
function processResult(xData, status) {
$(xData.responseXML).find("TestList1").each(function() {
$("#data").append("<li>" + $(this).attr("Title") + "</li>");
});
}
</script>