How to Show Status Message in SharePoint 2013?

Requirement: After the launch of new SharePoint intranet portal, we wanted to display a status message in each page.

Solution: Here is the script to display status message using SharePoint Javascript client side object model.

<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(AddStatusMessage, "sp.js");

function AddStatusMessage()
{
var statusID = SP.UI.Status.addStatus("Welcome","Welcome to New Crescent Portal. Feel free to contact <a href='mailto:[email protected]'>Helpdesk </a> if you have any queries");

SP.UI.Status.setStatusPriColor(statusID, 'green');
}
</script> 

and the result of SharePoint 2013 status message:

sharepoint 2010 status message

This script can be used in Master pages or in Script editor web parts.

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply