Demo only works on JSFiddle

0

My problem can be a very simple thing, is that I'm new to script programming and I'm getting pretty much! I can not make this demo work in my .html file:

demo link in JSFidde: 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>

Is there something missing?

    
asked by anonymous 08.11.2018 / 15:35

1 answer

0

Failed to add references to jquery , which are automatically made in JSFiddle when you select to use jquery .

Only include in the HEAD the links:

link

link

link

Links copied from fiddle , but may be other versions of CDN or even download and use location.

Here is a related question, showing the full tag: Use local files if CDN is Offline

    
08.11.2018 / 16:21