title: Send a javascript variable to django view
body: <p>I am fetching the current url of the browser (which keeps changing) in a javascript variable (say var_url). I have a django model Url. I want to create its object using a view function <code>create_url()</code>. </p>
  
  <p>Earlier When I used a form, I used <code>request.POST['field']</code>. Now I don't have a form and I want to pass the value of var_url. How can that be done?</p>
  
  <p>This was my view function when I was using a form:</p>
  
  <pre><code>def create_url(request):
  if request.method == 'POST':
      text=request.POST['field']
      url_result=Url.objects.get_or_create(
          url_text=text
          )
      return HttpResponse('Url Object Created')
  </code></pre>
  
  <p>And the following was my form:</p>
  
  <pre><code>&lt;form name='urlForm' method="post" action="{% url 'create_url'%}" id="create" &gt;
          {% csrf_token %}
          &lt;input type="text" id="myurl" name="field"/&gt;
          &lt;input type="submit" name="submit" value="Submit"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Now rather than a form, I have this:</p>
  
  <pre><code>&lt;div id='results'&gt;&lt;/div&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      window.addEventListener('message',function(e){
          results.innerHTML = e.data;
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to send the content of div tag to my view function.</p>