Answers for "css and js on flask"

2

where to put js files in flask

<script src="{{url_for('static', filename='somejavascriptfile.js')}}"></script>
Posted by: Guest on October-19-2020
2

css and js on flask

<!-- Put in HTML file--> 

<!-- 
JS
parent_dir is reletive to Flask app.py dir
meaning: /main/app.py
		 /main/parent_dir/file.js
-->
<script src="{{url_for('parent_dir', filename='file.js')}}"></script>

<!-- 
CSS
parent_dir is reletive to Flask app.py dir
meaning: /main/app.py
		 /main/parent_dir/file.css
-->
        <link href="{{ url_for("parent_dir",filename="file.css")  }}" rel="stylesheet">
Posted by: Guest on November-04-2020
0

how to add js in flask

<script src="{{url_for('static', filename='js/modernizr-2.6.2.min.js')}}"></script>
Posted by: Guest on October-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language