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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top