// js
$.get('{% url edit_quote_subjects %}', { subjects: result, quote_id: quote_id, page : '{{page}}' }, function (data) {
if (data.new_subjects) {
console.log("New subjects data received from back end.");
$("#tags2_" + quote_id).html(data.new_subjects);
} else {
console.log("Ops - editQuoteSubjects returned no data.");
}
});
}
// or simpler:
$.get('{% url 'scigraph:ajax_instances' %}',
{ u: '{{uri}}' },
function (data) {
$("#instances_list").html(data);
});
// django
[...]
context.update({'snippet' : f1, 'mykoncepts' : True,
'SUBJECT_LABEL' : which_labels(request)['SUBJECT_LABEL']})
# return_str = render_block_to_string('bstrap3.2.0/components/tags_snippet.html',
return_str = render_block_to_string('bstrap3.2.0/components/sidebar_tagsinfo.html',
'snippet_tags_snippet',
context)
data = { 'new_subjects' : return_str }
json = simplejson.dumps(data)
return HttpResponse(json, mimetype='application/json')