[Answer]-Django – How to get a response variable from js file?

1👍

First, I think you want to send a dictionary to simplejson.dumps() like:

json_dump = simplejson.dumps({'pid': post.id})

Then, in your javascript function, you would get the id with your argument.pid like:

function myCallback(data){
    alert(data.pid);
}

Leave a comment