title: Running/Loading a Jinja2 macro on click
body: <p>I have a <code>Jinja2</code> macro that currently preloads immediately on my main page although the content is hidden and only displayed after a user clicks a menu item. I want to disable preloading and only load/display the macro's content only after a user has clicked a menu item. I'm not sure if the best way to do this is via <code>JQuery</code> or if there is a <code>Jinja2</code> or <code>HTML</code> way of doing this.</p>
  
  <p>Here is my menu item.</p>
  
  <pre><code>&lt;li class="my_class"&gt;
      &lt;a href="#" data-toggle="my_macro" data-target="#my_macro_id"&gt;Call My Macro&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>And here is my macro.</p>
  
  <pre><code>{{ macros.my_macro_func(macro_id='my_macro_id' macro_content=('my_macro' | my_macro_link)) }}
  </code></pre>
  
  <p>Both of these are currently located in my <code>main.html</code> page</p>
  
  <p>On the <code>Python</code>/ <code>Flask</code> side I have:</p>
  
  <pre><code>@app.template_filter(`my_macro_link`)
  def my_macro_link_filter_func(input='some_input')
      return Markup( get_values(input) )
  </code></pre>