D
D
d4p2022-03-25 16:01:12
Flask
d4p, 2022-03-25 16:01:12

Why doesn't jquery work in flask?

jquery in flask not working.

Connected in html page

<script src="{{url_for('static', filename='assets/js/lib/jquery.min.js')}}" type="text/javascript"></script>


below is the jquery code itself:
<script>
$('#btn-proudct-123').click(function() {
  alert('test');
  $('#myform').append('<input type="text" id="proruct-123" class="edit bk" name="product[]" value="Test" /></br>');
});
</script>


It works on jsfiddle, it works on a regular html page, but it doesn't work on a flask, I don't know why.
I re-read the whole Google, everyone writes that the only problem may be in the location of the file in the "static" folder, but everything is correct there, along the prescribed path - all the files are there!

What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question