Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
jQuery wrapper for retiring comment count via SharePoint Social Data Web Service
function CountCommentsOnUrl(url,result)
var soapEnv =
"<soap:Envelope xmlns:xsi='' xmlns:xsd='' xmlns:soap=''> \
<soap:Body> \
<CountCommentsOnUrl xmlns=''> \
<url>" + url + "</url> \
</CountCommentsOnUrl> \
</soap:Body> \
pageurl: url,
result: result,
url: "/_vti_bin/SocialDataService.asmx?op=CountCommentsOnUrl",
type: "POST",
dataType: "xml",
data: soapEnv,
contentType: "text/xml; charset=\"utf-8\"",
success: function(data, status, xhr){
if(this.result !== undefined) {
var commentCount = $('CountCommentsOnUrlResponse', data).find('CountCommentsOnUrlResult').text();
$(function() {
$('span.comments').each(function() {
var pageUrl = $(this).attr('pageurl');
var comment = $(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment