test/static/js/alarm/alarmmodule.js

48 lines
1.2 KiB
JavaScript

function play(nom) {
$("#id_play" + nom).addClass('disabled');
$("#id_stop" + nom).removeClass('disabled');
$("#id_rupor").show()
cmd = 'play';
async: true,
$.ajax({
type: 'POST', // метод отправки
url: window.location.pathname + 'play/?id=0', // путь к обработчику
data: {
"cmd": cmd
},
success: function (data) {
},
error: function (dataerr) {
alert('Error :'+dataerr)
stop(nom)
}
});
}
function stop(nom) {
$("#id_stop" + nom).addClass('disabled');
$("#id_play" + nom).removeClass('disabled');
$("#id_rupor").hide()
cmd = 'stop';
async: true,
$.ajax({
type: 'POST', // метод отправки
url: window.location.pathname + 'stop/?id=0', // путь к обработчику
data: {
"cmd": cmd
},
success: function (data) {
},
error: function (dataerr) {
alert('Error :' + dataerr)
}
});
}
function show() {
}