// Use function on page Without use return
function once_alert() {
// Create variable for check alert status in browser
var alertset = localStorage.getItem('alertset') || '';
// if value not set in browser > local storage - run alert
if (alertset != 'yes') {
// write alert message in "txt"
var txt = "Write once alert";
alert(txt);
localStorage.setItem('alertset','yes');
}
}
//# My Edition From :
//# Reference : https://stackoverflow.com/questions/24768067/display-alert-only-once
دیدگاهتان را بنویسید