title: Django- update division of base template after post without reload
body: <p>I want to include notifications in my base template as it is there in stackoverflow top left corner. I know this can be done by making custom <b>template tag</b> or custom <b>context processor</b>. </p>
  
  <p>Now my requirement is that I do not want to load notifications every time the page is loaded, rather I want to load notifications only when we click on the notifications icon.</p>
  
  <p>I don't know what other code or script is required as I am new to jquery/ajax.</p>
  
  <p>Please let me know if any other details are required. Thanks.</p>
  
  <p><b>Edit:</b>(adding following details)</p>
  
  <p>context_prrocessors.py:</p>
  
  <pre><code>def notifications(request):
   if request.POST and request.is_ajax:
    notify_obj = #some logic here
    return {'notify_obj': notify_obj}
  </code></pre>
  
  <p>base.html (partial):</p>
  
  <pre><code>&lt;div id="notify-div"&gt;
  &lt;form id="notify-form" method="post"&gt;
   &lt;input type="submit" name="notify" value="Show notifications"&gt;
   {% csrf_token %}
  &lt;/form&gt;
  {% for notify in notify_obj %}
   {{ notify.user.user_id.username }}, {{ notify.wish.wish_text }} - {{ notify.added }}
  {% endfor %}
  &lt;/div&gt;
  &lt;script&gt;
      $(document).ready(function() {
          $('#notify-form').submit(function() { // catch the form's submit event
              $.ajax({ // create an AJAX call...
                  data: $(this).serialize(), // get the form data
                  type: $(this).attr('method'), // GET or POST
                  url: $(this).attr('action'), // the file to call
                  success: function(response) { // on success..
                      $('#notify-div').html(response); // update the DIV
                  }
              });
              return false;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Please tell wht JS should I use here.</p>