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:[email protected]'>Helpdesk </a> if you have any queries");
SP.UI.Status.setStatusPriColor(statusID, 'green');
}
</script>
And the result of the SharePoint 2013 status message:
This script can be used in Master pages or Script editor web parts.