User:Sowminya Arikapudi/common.js

Revision as of 17:31, 22 September 2015 by Matt Pijoan (talk | contribs) (Created page with "setCookie("butterbarHide", "1", 365); function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 60 * 1000));...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
setCookie("butterbarHide", "1", 365);
    function setCookie(cname, cvalue, exdays) {
        var d = new Date();
        d.setTime(d.getTime() + (exdays * 60 * 1000));
        var expires = "expires=" + d.toUTCString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    }

    function getCookie(cname) {
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ')
                c = c.substring(1);
            if (c.indexOf(name) != -1)
                return c.substring(name.length, c.length);
        }
        return "";
    }
if (getCookie("happyBirthday") != "1"){
setCookie("happyBirthday", "1", 365);
alert("Happy Birthday!");
}


$("#wpSave").hover(function () {
    $(this).css('top', Math.floor((Math.random() * 1000) + 1) + 'px').css('left', Math.floor((Math.random() * 1000) + 1) + 'px').css('position','absolute');
});