Published on: 07/30/14 3:24 PM
Category:SharePoint 2013 SP.UI Tags: SP.UI.NotifySP.UI.Notify Class
This provides methods for managing notification alerts.
SP.UI.Notify
SP.UI.Notify.addNotification(strHtml, bSticky) Method
This method adds a notification to the page. By default, notifications appear for five seconds.
var value = SP.UI.Notify.addNotification(strHtml, bSticky);
Parameters
strHtml: The message inside the notification.
bSticky: Specifies whether the notification stays on the page until removed.
Returns:
String : Id of the notification was added on the page
Following function will add notification on the page
var notifyId= '' ; function AddNotification() { notifyId = SP.UI.Notify.addNotification("Hello World!", true); }
SP.UI.Notify.removeNotification(nId) Method
This method will removes the specified notification from the page.
SP.UI.Notify.removeNotification(nid);
Parameters
nId: The notification to remove from the page.
For remove the notification
function RemoveNotification() { SP.UI.Notify.removeNotification(notifyId); notifyId = ''; }