.ajax partial response

.ajax partial response

I'm having a problem using .ajax to request a page and display the content ( partial content ) as it returns in chunks.

I'm using django for the site and I return an iterator using the HttpResponse object.

return HttpResponse(myiter)

Now if I request the page normally I see the data come back in segments.  This is important because the page is searching for things and it takes time to complete a large search.

localhost:33001/app/search?name=billywilly&domain=enie

That returns the results as they come in.  In other words the html page displays results as it loads and this gives the user some indication of whats going on. Python/django cannot template an iterator so I can format/style/position the data using an ajax request on an already loaded page.

Using agax I have something like this :

  1. $("#button").click(function()
    {
        $("#results").html("");
        var domain = $("#domain").val();
        var name = $("#name").val();
        var url = "/domains/search?domain=" + domain + "&name=" + name;
        var results = $.ajax({
        type: "GET",
        async: true,
        url: url,
        datatype: "html",
        error: function(error, textStatus){
            alert("Error in requesting page" + error);
        },
        success: function(response, textStatus){
            $("#results").html(response);
        },
        complete: function(){
           ....... 
        }
        });
        $("#search_status").html('working ... <img src="/site_media/domains/images/loading.gif">');
    });





















The success callback only displays when the url used in the ajax call is fully loaded.
Where I assign :  var results = $.ajax(...
I get returned a xmlHttpRequest object how can I view the partial content of results.responseText or use it to update my page? 
Or is there a more elegant and "Jquery" way to achieve this.

Any help is greatly appreciated, thanks

Niall