I need to show a #IE only on first load of page,I dont want it on refresh ,I tried this,but it wont work for me... I explicitly need this to work with localStorage,not with session or session storage ,regarding this link: https://stackoverflow.com/a/5523174/8735029
HTML:
<p id="IE">You are not using MS browsers! Good Job!<span>x</span></p>
JS
<script>
// detect IE8 and above, and Edge
if (document.documentMode || /Edge/.test(navigator.userAgent)) {
document.getElementById('IE').innerHTML = "You are using a MS browser,please consider using Chrome or Firefox for better experience!<span>x</span>"
}
</script>
JQuery:
<script>
$(document).ready(function () {
if (localStorage.getItem('wasVisited') !== undefined) {
$("#IE").fadeIn("slow").css("display": "flex");
} else {
localStorage.setItem('wasVisited', 1);
$("#IE span").click(function(){
$("#IE").fadeOut("slow");
});
}
});
</script>