CHUVASH.eu
  • About
  • Search
X GitHub
Remove links to user profiles on list with javascript
Posts

Remove links to user profiles on list with javascript

Anatoly Mironov

October 25, 2011

Well, if you need remove links to user profiles, you can iterate all td-elements with class ms-vb-user using jQuery each function and remove a elements. Here is a little script:

$(document).ready(function() {
	$(".ms-vb-user a").each(function() { 
	   var text = $(this).text(); 
	   var span = document.createElement("span"); 
	   var user = document.createTextNode(text); 
	   span.appendChild(user); 
	   var parent = $(this).parent()\[0\]; 
	   parent.removeChild(this); 
	   parent.appendChild(span); 
	});
});
```EDIT 2012-02-05 A much more better way to do it is [to use replaceWith in jQuery](http://stackoverflow.com/a/2409163/632117 "See a similar question and an answer on StackOverflow"):

$(".ms-vb-user a").each(function() { $(this).replaceWith(this.childNodes); });

  • DOM
  • Javascript
  • JQuery
  • SharePoint

Related

  • Auto-resize the main container in master page
  • Check if an html element is hidden using jQuery
  • Reset favicon cache
  • Go back in javascript
  • Resize image with jQuery to fit the div
  • window.onload
  • jQuery validation with asp.net
  • jquery confirm
  • Aktivera intellisense för javascript i VS
  • Validera din form på klienten
  • Ladda jQuery dynamiskt till din sida
  • Polymorfi och javascript
  • Show files first in view
  • Hide my site link with css
  • Uninstall custom features in a batch
© CHUVASH.eu 2026
X GitHub