无法调用ajax / dajax方法

I am writing a django app where the user wants to click a button and have a partial page change. Data needs passed from the server to the web page without a needing a complete page refresh. That task sounded like a job for ajax. However, I can't make Ajax work in my app.

I cannot get the call into my server-side function. Below is the code the subject matter is regarding missed calls. My intent is to get the server side to return a list of missed calls and display it to the user without having to refresh the page.

When I click the button, I get a popup that says "Something goes wrong" using firebug, I traced this to a DAJAXICE_EXCEPTION but I don't know anything else about it.

What's going on here? How do I make this work? Also if there's an easier way to do this that doesn't require the Dajax library please advise. And any step-by-step examples would be very helpful.

Server side function

-------- /jim/ajax.py---------

@dajaxice_register 
def missedCalls(request, user): 
    print "Ajax:missedCalls"    #never prints...
    missedCalls = ScheduledCall.objects.filter(status__exact='Missed') 
    render = render_to_string('examples/pagination_page.html', { 'missedCalls': missedCalls }) 
    dajax = Dajax() 
    dajax.assign('#calls','innerHTML', render) 
    return dajax.json() 

-------page.html---------

 <script type='text/javascript'>
   function missed_calls_callback(data){
      # The dajax library wants a function as a return call.
      # Have no idea what I'm supposed to do with this part of the function.
      # what is supposed to go here?
      alert(data.message);
   }  
 </script>

 <!-- Button -->
 <input type="button" name="calltest" value="JQuery Test" 
    id="calltest" onclick="Dajaxice.jim.missedCalls(missed_calls_callback, {'user':{{ user }}})">


  <div id="calls">
     {% include "calls.html" %}
  </div>

--------calls.html--------

<h2> Missed Calls</h2>
<ul>         
{% for i in missedCalls.object_list %}         
    <li>{{ i }}</li>
{% endfor %}     
</ul>  

Before you start using a library, if might be helpful to do manually (to see what's going on).

An ajax request is a HTTP request like any other except that it happens asynchronously (i.e. outside the normal request/response cycle) and it usually returns json or xml (although you can return html if you like).

This means that to accept an AJAX request you just create an url and view as you would normally.

urls.py

...
url(r"^/my/ajax/path/$", myapp.views.ajax_view, name="do-something-ajaxy"),
...

views.py

def ajax_view(self, request):
    # Django's Request objects have a method is_ajax()* 
    # which checks the header to see if it's an 'ajax' request
    if request.is_ajax():
        raise Http404
    missedCalls = ScheduledCall.objects.filter(status__exact='Missed') 
    # You can return a dictionary-like json object which can be manipulated by the javascript when it receives it
    return HttpResponse(simplejson.dumps(missedCalls), mimetype='application/javascript')

https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.is_ajax

And using jquery to carry out the ajax request:

(function($){
    $.ajax({
        type: 'GET',
        url: '/my/ajax/path/',
        success: function(data){
            for call in data:
                /* Do something with each missed call */
        },
    });
});