How to show popup text message on website visits?

Show popup text message when someone visits on your website

Just edit yellow marked lines in your text and paste this code after <head> in your index.html webpage or on other webpage where you want to show popup message.

<script>
//Alert message once script by Vishal Jaiswal.
//Visit http://www.vikinspire.com for this script.
//specify message to alert
var alertmessage="Welcome to website."
///No editing required beyond here/////
//Alert only once per browser session (0=no, 1=yes)
var once_per_session=1
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>

JOIN US TODAY! with How To Learn Blog

Please note before commenting on this page.
1. Don't comment as for advertisement purpose.
2. Don't hyperlink your website inside comment box.
3. Abuses are strictly prohibited.
4. If necessary, you can post the only URL without any text hyperlink. ConversionConversion EmoticonEmoticon