Pergunta

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.

Foi útil?

Solução

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 em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top