I have problem and can't see the error here, I want to pass some variables into newly generated template and then access it with javascript. But template is rendering empty value. But I can see in console that variables are not empty.
The views.py
arguments={'ram_count':ram_count,
'max_ram':max_ram}
print(arguments['ram_count'])
print(arguments['max_ram'])
return render(request,'generated_elements.html',arguments)
The template
<option value={{ ram_count }}>{{ ram_count }}</option>
<option value={{ max_ram }}>{{ max_ram }}</option>
This is javascript code to get data to element
function ajax_method(parent_id,url,id_name){
$.ajax({
url: url,
data: {
'parent_id': parent_id,
'target_element':id_name,
},
success: function (data) {
$(id_name).html(data);
}
});
Any help will be appreciated