javascript - Displaying a modal per browser session? -


i testing changing cookie values nothing working want show popup per browser session.

code

function setcookie(cname,cvalue,hours){          var d = new date();         d.settime(d.gettime()+(hours*60*1000));          var expires = "expires="+d.togmtstring();         document.cookie = cname + "=" + cvalue + "; " + expires;     }                     if(response.result == "success"){                     jquery('.errordiv').hide();                     jquery('.message').html('thank subscribing us.');                     /*jquery(".subscription-error").hide();                     jquery(".registration-form").fadeout("slow", function(){                          jquery(".congrats").fadein("slow");                      });*/                     setcookie("online-popup", 1, 24*30*12);                 }else{                     jquery('.message').hide();                     jquery('.errordiv').html('this email address subscribed..');                 }             }         });     }      jquery(document).ready(function(){          if(!getcookie("online-popup")){              jquery(".popup-overlay").fadein(400, function(){                 // show again in 4 hours                 setcookie("online-popup", 1, 4);             });         } 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -