본문 바로가기
개발언어/SharePoint

Sharepoint 쉐어포인트 성명에 링크 없애기 Jquery/Javascript

by 엔돌슨 2013. 11. 27.
반응형

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:

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