0
My problem can be a very simple thing, is that I’m new to script programming and I’m getting a lot of hits! I cannot make this demo work in my.html file:
Jsfidde demo link: https://jsfiddle.net/h5q7pe3m/33/
I put the following in my . html:
<div id="allow-or-not" title="Show Again?">
<p>Would you like to show this dialog again?</p>
<button name="yes" class="ok allowed">Yes</button>
<button name="no" id="exit">No</button>
</div>
<script src="jquery.min.js"></script>
<script>
if (!localStorage.hideAlert) {
$(function() {
$("#allow-or-not").dialog();
});
} else {
$("#allow-or-not").css("display", "none");
}
$(".ok.allowed").on("click", function() {
$("#allow-or-not").dialog("close");
});
$("#exit").on("click", function() {
localStorage.setItem('hideAlert', true);
$("#allow-or-not").dialog("close");
});
</script>
There’s something that’s missing?
The references to the
jquery
in thehead
of your page? If you look at fiddle’s Resources, you will see that it has the pro linksjquery
andjqueryui
– Ricardo Pontual
Thanks @Ricardopunctual, I had not even realized I had that part of Resources there rss, now I was aware! (want to add your comment as reply I can mark as certain)
– Thiago Soubra
I added as a response, even if someone already needs direct links.
– Ricardo Pontual