Answer the question
In order to leave comments, you need to log in
Django and JavaScript throw values in different sessions!?
Guys, help.
I put the value in the session in the Django view:
Then I delete this value from the session (I took examples of deletion from here and from here ):request.session['battary_charge'] = 11
$(document).ready(function () {
$("#destroy_charge").click(function () {
//1-ый способ используя jquerySessionPlugin сбрасываем заряд удаляя ключ battary_charged
$.session.remove('battary_charge');
//2-ой способ используя инструменты HTML5 сбрасываем заряд удаляя ключ battary_charged
sessionStorage.removeItem('battary_charge');
//проверяю наличие
console.log($.session.get('battary_charge'));
console.log(sessionStorage.removeItem('battary_charge'));
//перенаправляем на страницу Зарядки+поиска
window.location.replace("/");
})
});
undefined
undefined
print(request.session['battary_charge'])
11
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question