[Django]-Django template with jquery: Ajax update on existing page

2👍

Without being able to test the code, what are your results? Have you checked the results returned by the AJAX call? I would suggest you run Firefox with Firebug and log the AJAX results to the Firebug console to see what you get:

//...
        success: function( result ) { 
        console.log( result );
      $('#SubmitForm').after( "<div><tt>" + 
// ...

You can also use the Net panel of Firebug to see what is being passed back and forth.

Also, what does “simplejson.dumps(result)” result in?

👤Seamus

1👍

here is an example of my success function

success: function(json){
                $('#gallons_cont').html(json['gallons']);
                $('#area_cont').html(json['area']);
                $('#usage_cont').html(json['usage'])
                $('#results_json').show('slow');            
            },

please note that you do have to debug using firebug or something similar as there might be some issue serializing which will throw and error but will not be vieweable unless you use something like firebug or implement .ajax error

👤Rasiel

Leave a comment