hide onload popup after page second time refresh

I want to hide onload popup after page second time refresh.

HTML:

<div class='popup'>
<div class='cnt223'>
<button type="button" class="close previous">&times;</button>
<div>
<img src="assets/images/homepopup.jpg" alt="image" class="img-responsive"/>
</div>
<p class="text-center">
<br/>
Do You Want To Upgrade Your Profile?
<br/>
</p>
<span style="color:#F00;"><i class="fa fa-exclamation-triangle" style="font-size:16px;"></i>&nbsp;Please Do Not Share Your User ID, Password & OTP To Any One.</span>
 <div id="msform">
  <input type="button" name="cancel" class="previous action-button-previous" value="Remind Me Later" style="width:155px;"/>
                <input type="submit" name="submit" class="previous action-button" value="I Want To Upgrade" style="width:155px;"/>
                </div>

</div>
</div>

<script type='text/javascript'>
$(function(){
var overlay = $('<div class="overlay"></div>');
overlay.show();
overlay.appendTo(document.body);
$('.popup').show();
$('.previous').click(function(){
$('.popup').hide();
overlay.appendTo(document.body).remove();
return false;
});
$('.x').click(function(){
$('.popup').hide();
overlay.appendTo(document.body).remove();
return false;
});
});

</script>
Suraiya ParvinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mohan singhWeb developerCommented:
Try this

You can use localstorage. It is easy to understand and use
$(document).ready(function() {
    var isshow = localStorage.getItem('isshow');
    if (isshow== null) {
        localStorage.setItem('isshow', 1);

        // Show popup here
        $('#jPopup').show();
    }
});

Open in new window


It will show you the popup at first visit of your site.

https://stackoverflow.com/questions/32155036/show-jquery-popup-only-at-first-visit-of-a-page
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Suraiya ParvinAuthor Commented:
thank you so much @mohan singh for you answer
1
mohan singhWeb developerCommented:
Hi @ Suraiya Parvin
above code is working or not


Regards
Mohan SIngh
0
mohan singhWeb developerCommented:
It works good
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.