javascript - Pop up box only displaying once using cookie -
javascript - Pop up box only displaying once using cookie -
i need assistance getting pop box display 1 time using cookies.
i've set pop box , hoping assist me additional cookies script add together onto current setup.
http://jsfiddle.net/ucvw8/
jq(function() { var id; id = "popupsignup"; if (jq(".popupwindow").length) { jq(".popupwindow").prop("id", id); } else { jq("#aspnetform").after('<div id="popupsignup" class="popupwindow"><a class="popupclose" href="javascript:;"></a><div class="popupdetails"></div></div><div class="backgroundpopup"></div>'); } jq("#" + id + " .popupdetails").html("put html here"); initialisepopup(id, 99, false, true); showpopup(); centerpopup(); });
sorry if seems amateur i'm still trying knowledge up.
thanks in advance.
document.cookie
simple long string. if want utilize cookie command "once user"
function getcookie(key) { // parse document.cookie // ... homecoming val } function setcookie(key, val) { // encode val , set document.cookie // ... homecoming succeeded } $(function(){ if (! getcookie("alreadyalerted")) { alert("something"); setcookie("alreadyalerted", true); } })
if ok utilize way other cookie, how window.localstorage, window.sessionstorage or so?
javascript jquery cookies
Comments
Post a Comment