April 30, 2010

Javascipt in Content Editor Webpart

<script language="JavaScript">
_spBodyOnLoadFunctionNames.push("HideLink");
function HideLink()
{
var currentUser = getCurrentUser();
if(currentUser == 'New Consultant')
{
var emp = document.getElementById("emp");
emp.style.display = "none";
}
if(currentUser == 'New Employee')
{
var con= document.getElementById("con");
con.style.display = "none";
}
}
function getCurrentUser()
{
var tags = document.getElementsByTagName('a');
for (var i=0; i < tags.length; i++)
{
if(tags[i].innerText.substr(0,7) == 'Welcome')
{
return tags[i].innerText.substr(8,tags[i].innerText.length);
}
}
}
</Script>

No comments:

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...