title: Flask: show flash messages in alertbox
body: <p>I've been working on flask and I came across flash. It displays a message on page if flash was called on the server side. However, I'd like to display the contents get_flashed_messages() in an alertbox. I tried to make JS function and pass {{message}} but the loop prints the call i.e. takes the call as a string.</p>
  
  <pre><code>{% with messages = get_flashed_messages() %}
  {% if messages %}
   &lt;ul class=flashes&gt;
   {% for message in messages %}
    &lt;li&gt;{{ message }}&lt;/li&gt;
   {% endfor %}
   &lt;/ul&gt;
  {% endif %}
  {% endwith %}
  </code></pre>
  
  <p>IS there any way to go about it?</p>