Skip to content

Instantly share code, notes, and snippets.

@chico
Created July 31, 2011 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chico/1116723 to your computer and use it in GitHub Desktop.
Save chico/1116723 to your computer and use it in GitHub Desktop.
Growl Notification for New Web Visitors
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="http://stanlemon.net/javascript/jquery.jgrowl.js" type="text/javascript"></script>
<script src="https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://stanlemon.net/stylesheet/jquery.jgrowl.css" type="text/css"/>
<style>
.jGrowl a {color:yellow; text-decoration: none;}
</style>
</head>
<body>
<script type="text/javascript">
$(function () {
if($.cookie("new_visitor") != "true") {
$.cookie("new_visitor", "true", { expires: 365, path: '/' });
$.jGrowl("Hello. New visitor?<br/><br/><a href='#'>Register</a>", {sticky: true});
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment