Question

I'm wondering how to create a pop-up agreement when someone visits my blog.

I tried some pop-ups using JavaScript but none of them work.

Actually I want the visitor to agree with my terms and conditions when they visit my blog.

Was it helpful?

Solution

You can do this:

var hasAgreed = confirm("Do you agree my terms and condition?");

If the user accepts, hasAgreed will have true else false

Put that in onload event of your page and then store the response in a cookie and don't ask them next time by doing a simple if.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top