title: Ajax request from django template, url and view
body: <p>I have following settings</p>
  
  <p><strong>URL</strong></p>
  
  <pre><code>urlpatterns = patterns('',
     (r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}),
      url(r'^index/$','pMass.views.index', name='index'),
      url(r'^index/(?P&lt;match&gt;\d+)/(?P&lt;tab&gt;\d)$', 'pMass.views.detail',name='detail'),
  </code></pre>
  
  <p><strong>VIEW</strong></p>
  
  <pre><code>def index(request):
      error = False
      cid = request.GET
  
      if 'cnum' in request.GET:
         cid = request.GET['cnum']
  
      if not cid:
         error = False
         expcount = Experiment.objects.count()
         allmass = SelectedIon.objects.count()
  
      else:
  
          defmass = 0.000001
          massvalue = float(cid)
          masscon = defmass * massvalue
          highrange = massvalue + masscon
          lowrange = massvalue - masscon
  
          myquery = SelectedIon.objects.select_related().filter(monoiso__range=(lowrange, highrange))
          querycount = myquery.count()
  
          return render_to_response('queryresult1.html', {'query': cid, 'high':highrange, 'low':lowrange, 'sections':myquery, 'qcount':querycount, })
  
  
      return render_to_response('index.html', {'error': error, 'exp': expcount,'mass':allmass,})
  
  
  def detail(request,  match, tab):
      monorecord = get_object_or_404(SelectedIon, monoiso=match)
      detailrec = SelectedIon.objects.filter(monoiso=monorecord)
      return render_to_response('queryresult1.html', {"id": monorecord, "detail": detailrec}, context_instance=RequestContext(request))
  </code></pre>
  
  <p><strong>Template</strong>      <code>// from where I am trying to send request</code></p>
  
  <pre><code>$("td a").bind("click", function(event){
  
          var str = $(this).attr('id');
          tab = $("ul.tabs li").find("a").attr('id');
          mapurl = 'match/'+ str+ '/tab/'+ tab;
  
          new $.ajax({
          url: mapurl,
          async: true,
          // The function below will be reached when the request has completed
          success: function(transport)
          {
              $("#result").html(transport); // Put data in the div
              $("result").fadeIn();        // Fade in the active content
          }
      });
  </code></pre>
  
  <p>I am trying to send <strong>ajax request</strong> to server and get result back in the same queryresult1.html template (result containter). But, I am getting problem in my request</p>
  
  <pre><code>`Error`     [11:18:37.814] GET http://127.0.0.1:8000/index/match/622/tab/1 [HTTP/1.0 404 NOT FOUND 59ms]
  </code></pre>
  
  <p>I think my url configuraton is right? How can I solve my <strong>ajax request from template</strong> with it's corresponding url and view?</p>