I guys not sure if anyone here will be able to help me , ive been trying to do this all night. Im not good with Javascript . Ive got this popup script which popups on pageload currently , but i would like it to only pop up once per day per visitor etc. How would i do this ? <vb:if condition="is_member_of($bbuserinfo, 48,1,3,5,7,4,2)"> <vb:if condition="THIS_SCRIPT == 'index'"> <link rel="stylesheet" href="dhtmlwindow.css" type="text/css" /> <script type="text/javascript" src="dhtmlwindow.js"></script> <script type="text/javascript"> function openmypage(){ //Define arbitrary function to run desired DHTML Window widget codes ajaxwin=dhtmlwindow.open("ajaxbox", "ajax", "only-popup-once.html", "Click to sign up", "width=773px,height=701px,left=300px,top=20px,resize=1,scrolling=1") ajaxwin.onclose=function(){return window.confirm("Close Promotional Banner")} //Run custom code when window is about to be closed } onload=openmypage(); </script> </vb:if></vb:if> Code (markup): Thanks for any help, Please remember im not good with Javascript so if possible could you provide the code or samples so its easy to understand haha.
if you only require only javascript w/o any server-side scripting, you can try this... function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } } function doPopup() { var doPop = false; if(getCookie('pop')) { var curdate = new Date(); var ckdate = new Date(getCookie('pop')); if((curdate.getTime() - ckdate.getTime()) >= 86400) doPop = true; } else doPop = true; if(doPop) { // do popup script here... } } PHP: Note: I took the getCookie function from here. Browsers have the option to remove cookies so this might not work to some people.