Skip to content Skip to sidebar Skip to footer

How To Open New Tab Only 1 Time?

With above code, when I click anywhere, the tab will be opened.

Solution 1:

Use jquery .one() http://api.jquery.com/one/

<script>
$(document).one("click",function() { window.open("http://google.com", "_blank");});
</script>

Post a Comment for "How To Open New Tab Only 1 Time?"