[Answer]-Unable to get response object in ajax

0👍

I think I got my problem.
I didn’t have to do

  render_to_response('template.html'....)

Instead

  HttpResponse(json.dumps(value))
👤Sohaib

1👍

Why don’t you put a console.log in your showResponse function for a start?
So

function showResponse(data){
      console.log(data);
}

You will then see easily what to do.

0👍

Use parseJSON method to parse json string. Below is the code you need to put in alert

jQuery.parseJSON(data).response

Leave a comment