javascript - Show modal to user when updated -
i have made modal , shows on first visit website
$(document).ready(function(){ settimeout(function(){ if(!cookies.get('modalshown')) { $("#mymodal").modal('show'); cookies.set('modalshown', true); } else { alert('you saw modal') } },1000); });
in modal shows content of new functionality application added. target to show modal user every time update modal content. how can this?
you use versionning in cookies values :
var currentrelease = "1.0.1", currcookie = cookies.get('modalshown') settimeout(function(){ if(!currcookie || currcookie != currentrelease) { $("#mymodal").modal('show'); cookies.set('modalshown', currentrelease); } else { alert('you saw modal') } },1000);
note method forces update value of "currentrelease" crypt text content of modal md5 , use value in cookie, whenever modal value change, md5 changes
Comments
Post a Comment