Tuesday, December 4, 2012

Java script to hide the Top Visitors Link SharePoint

 Java script to hide the Top Visitors link in Sharepoint

Addd  the Java script below the tag line

  asp:Content ID="Content1" runat="server" ContentPlaceHolderID="PlaceHolderLeftNavBar" 




Java script to hide the Top Visitors Url 

  script type="text/javascript"
var cc = document.getElementsByTagName("a");
for (var i=0; i{
if (cc[i].href =="http://servername:80/sites/Test/_layouts/WebAnalytics/Report.aspx?t=TopVisitorsReport&l=s" ||cc[i].href =="
http://servername:80/sites/Test/_layouts/WebAnalytics/Report.aspx?t=TopVisitorsReport&l=sc")

{

  cc[i].style.display="none";
}

}
/script



Disadvantages:

Hide the url but if the user know the direct link means user can able to see the Top visitors list.
Hide the Top visitor link only site collection level only not Web application level