M
M
mraser2020-05-06 20:28:29
JavaScript
mraser, 2020-05-06 20:28:29

How, after closing the popup, it did not open when the page was reloaded?

When you enter the site, a popup opens.
How to make a popup open when you first enter the site. After clicking on the confirm button, the popup closed and did not open again when the page was reloaded?

here is the code
https://jsbin.com/lupekipeko/1/edit?html,js,output

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Pike, 2020-05-06
@AndyPike

What kind of cookies are here, where?
Mixed localStorage and sessionStorage.
Store everything in localStorage.
Well, I will write that a bunch of unnecessary variables that are not used.

sessionStorage.setItem('is_reloaded', 'no');
    if(sessionStorage.getItem('is_reloaded') == 'no') { ... }

So you can't write code.
Set a variable, and immediately check it for the value that was assigned.
I think you need to learn.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question