How to Show information / warnings in SharePoint


In SharePoint , Status bar is used to display information / warnings  using Javascript.This script is added at the client side.


The status script functions are listed out in the SP.UI.Status class. in SP.js which is added in master page by default.

The SP.UI.Status class has 6 functions.

           1. addStatus   – used to add the status bar information

           2. appendStatus  – used to append the information

           3. removeAllStatus – remove all  status

           4. removeStatus – remove status

           5. setStatusPriColor – used to set color for the status bar information

           6. updateStatus – update  / replage the status information

So simply follow the steps the to add the information / warning in SharePoint  site.


 1. Add a Script Editor / Content editor web part in the page



2. Edit snippet and add the below code to show the information.

window.onload = function(){

var Status;

Status = SP.UI.Status.addStatus(“Information : “, “ We sincerely apologize for the inconvenience.Our site is currently undergoing maintenance and upgrades and will return return shortly.“, true);

  SP.UI.Status.setStatusPriColor(Status, “yellow”);

  }


3. Save the page and refresh.


Now the page looks as below



Woo hoo , Now its very simple to show the notification for alerts/ warnings in SharePoint site.


For more info , refer https://goo.gl/45xmbX

Thanks for reading this article!! please leave your comments and suggestion about this article.