Showing posts with label Alert. Show all posts
Showing posts with label Alert. Show all posts

Thursday, March 29, 2012

Alert pop up windows in SharePoint site


I found following JavaScript (obviously on internet, I am not a core developer) and placed it in CEWP on above mentioned site. In fact I did little changes in code to get required pop up with message and to display it once when page load first time in new window.

<script language='JavaScript'>
//<![CDATA[
var alertmessage="This is the test popup"
//Alert only once per browser session (0=no, 1=yes)
var once_per_session=0
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function alertornot(){
if (get_cookie('alerted')==''){
loadalert()
document.cookie="alerted=yes"
}
}
function loadalert(){
alert(alertmessage)
}
if (once_per_session==0)
loadalert()
else
alertornot()
//]]>
</script>
To display a particular message on the popup we have to replaced “This is the test popup” lines highlighted in script, and to change popup display per session we have to change variable to “0” or “1” (please refer highlighted “var once_per_session=0”)

Sunday, September 18, 2011

Unable to send Alerts to a user or Group

Issue

Whenever you add a user or  group to alerts section in a library\list. Alerts are not getting delivered when anything is changed.

Resolution

Make sure those groups are added in the Library\Lists permissions. They should atleast have read access to get the alerts.