type="button" onclick="OFFparser()" value="${_csrf.token}"">Выключить парсер</button>
function OFFparser() {
let xhr = new XMLHttpRequest();
xhr.open('GET', '/?parser=OFF', );
xhr.send();
}
function ONparser() {
let xhr = new XMLHttpRequest();
xhr.open('GET', '/?parser=ON', );
xhr.send();
}
views.py
if request.GET.get('parser', '') == 'ON': on_parser()
elif request.GET.get('parser', '') == 'OFF': off_parser()
въюха вызывается ?
Обсуждают сегодня