Jump to content

HTML Cookies popup.

WillLTT
Go to solution Solved by FlappyBoobs,

All you need is a div that pops up on page load if there is no cookie set saying the user has clicked accept. In the div place your text and a button that when clicked sets a cookie to say the user has accepted cookies (this is the value you check on page load). 

 

Use w3c for help with the parts you don't understand, you need to learn about creating and reading cookies in java script, and also how to show a div over the top of others. Also look at the onclick java script event. 

How do i add popup, i cant find the right js please, tell me how to do this.

ive tried over 40 sites, none work.

 

Also i dont want the popup to go away after refreshing.

Link to comment
Share on other sites

Link to post
Share on other sites

All you need is a div that pops up on page load if there is no cookie set saying the user has clicked accept. In the div place your text and a button that when clicked sets a cookie to say the user has accepted cookies (this is the value you check on page load). 

 

Use w3c for help with the parts you don't understand, you need to learn about creating and reading cookies in java script, and also how to show a div over the top of others. Also look at the onclick java script event. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×