TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Delete Sharepoint List Item using Javascript
Sagar Pardeshi
Aug 06
2014
Code
2
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<script type=
"text/javascript"
>
function
Delete ()
{
var
UpdateNewItemXml=
"<Batch OnError='Continue' ListVersion='1'>"
+
"<Method ID=\"1\" Cmd=\"Delete\">"
+
"<Field Name='ID'>2</Field>"
+
"<Field Name='Name'>Mack</Field>"
+
"</Method>"
+
"</Batch>"
;
FeedbackHTTP =
new
ActiveXObject(
"MSXML2.XMLHTTP.3.0"
);
FeedbackHTTP.Open(
"POST"
,
"http://sp2k10srvr:800/sites/test/_vti_bin/lists.asmx"
,
false
);
FeedbackHTTP.setRequestHeader(
"Content-Type"
,
"text/xml; charset=utf-8"
);
FeedbackHTTP.setRequestHeader(
"SOAPAction"
,
"http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"
);
var
strSOAP =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+
"<soap:Envelopexmlns:xsi=\"http://www.w3.org/2001/XMLSchemainstance\"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+
"<soap:Body>"
+
"<UpdateListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">"
+
"<listName>31stmay</listName>"
+
"<updates>"
+ UpdateNewItemXml +
"</updates>"
+
"</UpdateListItems>"
+
"</soap:Body>"
+
"</soap:Envelope>"
;
FeedbackHTTP.Send(strSOAP);
alert(
"Thank you! your suggestion has been Deleted successfully."
);
}
</script>
lists.asmx
Deleting List items using SharePoint Web Services javascript