Answers for "calling flask python code in js"

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
0

javascript function from python flask

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Upload new File</title>
</head>
<body onload="flashMessage()">
  <script>
    function flashMessage() {
      if ("{{ flash_message }}" == "True") {
        alert("[YOUR_MESSAGE_HERE]");
      }
    }
  </script>

  <h1>Upload new File</h1>
  <form method=post enctype=multipart/form-data>
    <input type=file name=file>
    <input type=submit value=Upload>
  </form>
</body>
</html>
Posted by: Guest on October-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language