<script>
$(document).ready(function () {
$(window).on('beforeunload', function () {
$.ajax({
// type: 'GET',
url: "{% url 'size_reducer:data_delete' id %}",
dataType: 'json',
success: function (data) {
console.log('ok');
}
})
});
});
</script>
I'm encountering an issue trying to include the ID in the AJAX URL, as it seems unable to retrieve the ID.