How to Show a Status Message in SharePoint 2013/2016?

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

Solution: Here is the script to display a status message using the 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:support@crescent.com'>Helpdesk </a> if you have any queries");

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

And the result of the SharePoint 2013 status message:

sharepoint 2010 status message

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

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *