I have to make an ajax call from my template.html. The view takes in an id parameter which I have obtained from the jquery part. How do I append it to my url?
Thank you
Here is the code:
<script>
..... #some codes
app_div_id = $(this).closest('div').attr('id')
var index = app_div_id.lastIndexOf("_");
var result = app_div_id.substr(index+1);
var app_id = parseInt(result);
$.ajax({
url:"{% url 'update_status' %}", #this url takes in an id param
data:{
'new_app_status':app_status,
},
success: function (response) {
},
error: function (response) {
console.log(response.errors);
},
});
});
</script>