문제

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