title: Show javascript variable in django
body: <p>I have a function that, when the form is submitted, shows a pop up. In that pop up i have  a link <code>&lt;a class=&quot;btn btn-primary&quot; href=&quot;{{ url 'enviado' name=? mail=?  }}&quot;&gt;Join&lt;/a&gt;</code></p>
  <p>I want to pass my js variables there. This is my code:</p>
  <p>My js:</p>
  <pre><code>document.querySelector('#elform').addEventListener(&quot;submit&quot;, function(event) {
  
    event.preventDefault();
  
      fetch(&quot;&quot;, {
  
        method: 'POST',
        body: JSON.stringify({
          mail: document.querySelector('#email').value,
          name: document.querySelector('#name').value
        }),
        headers: {
          &quot;Content-type&quot;: &quot;application/json; charset=UTF-8&quot;,
          &quot;X-CSRFToken&quot;: getCookie('csrftoken')
        }
      })
      .then(response =&gt; response.json())
      .then(result =&gt; {
            popup_content('show');
         
          }
      });
  }
    });
  })
  
  </code></pre>
  <p>My html, the pop up content:</p>
  <pre><code>&lt;div id=&quot;popup_content_wrap&quot; style='display:none'&gt;
        &lt;div align=&quot;center&quot; id=&quot;popup_content&quot;&gt;
            &lt;center&gt;
                 &lt;p&gt;Welcome&lt;/p&gt;
  
                  &lt;a class=&quot;btn btn-primary&quot; href=&quot;{{ url 'enviado' name=? mail=?  }}&quot;&gt;Join&lt;/a&gt;
  
                &lt;a align=&quot;right&quot; type=&quot;submit&quot; name=&quot;submit&quot; onClick=&quot;popup_content('hide')&quot;&gt;Go back&lt;/a&gt;
            &lt;/center&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  <p>Is there any way to do this?</p>