It is necessary for me that a specific adsense ad be shown to the user only 1 time, that is, after switching it, not to show it again, but after restarting the browser the advertisement would be shown again.
1 answer
https://jsfiddle.net/1knv6d29/ - a working example
if (sessionStorage.beenHere) { document.querySelector(".once-per-session").style.display = "none"; } sessionStorage.beenHere = true; .once-per-session { border:1px solid black; border-radius:5px; padding:10px; background-color:lightgreen; } <div class="once-per-session">Once per session.</div> - And in the place "Once per session" put the adsense ad code?) Excuse me, I'm just completely new - Eduard Ivanov
- ibb.co/gpJzxT So, and the weight is to put the code instead of the adsense code? - Edward Ivanov
- And instead of block adsense there will be an empty space (after the transition)? or the lower blocks of the site will rise up his place - Edward Ivanov
- And here's what else (Your changes in the PHP code were canceled due to an error on the line. Correct and try to save. Syntax error, unexpected '=' - Edward Ivanov
|
sessionStorage- w3schools.com/htmL/html5_webstorage.asp - Igor