I have a working Flask project. HTML file with 2 scripts:
<script>
$(document).ready(function(){
$(".dropdown").on("show.bs.dropdown", function(event){
var x = $(event.relatedTarget).text(); // Get the button text
<!--alert("You clicked on: " + x); -->
});
});
...</script>
<script>
window.onload = function () {
var allDates = []
...
</script>
I wanted to move the scripts externally for better organization of the code. I've opened file called history.js inside the static folder, and posted there the inside parts of the scripts (Without the tags)
Then I tried to include it in my history.html file:
<script type="text/javascript" src=""></script>
It didn't succeed. The JS part won't activate.
The files structure is good, Proj-Name | templates (contains the history.html, also extends base.html file) | static (contains the history.js)
What am I missing? I've tried to include the javascript part in several methods and still couldn't find out what is wrong.
Aucun commentaire:
Enregistrer un commentaire