Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top