Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
i want my alert notify no loop when i refresh my web
<script>alert('Hai Jangan lupa klik tombol Refresh!(Ok Untuk Lanjutkan)');</script>

when I refresh my website the alert notification keeps popping up, I only want the alert to appear only once when the web is first opened

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

A simple flag is what you need.

if(window.localStorage.getItem("visited")){
    alert("something");
    window.localStorage.setItem("visited", true)
}

Depending on what you want to setup the scope of the storage, you can checkout localStorage, sessionStorage or cookies What is the difference between localStorage, sessionStorage, session and cookies?

about 4 years ago · Juan Pablo Isaza Report

0

You can use localStorage and check if the alert has already popup.

if (localStorage.getItem('__isAlert') !== "show") {
  localStorage.setItem("__isAlert", "show");
  alert("Hai Jangan lupa klik tombol Refresh!(Ok Untuk Lanjutkan");
}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!