This commit is contained in:
2020-05-26 11:47:51 +07:00
parent 52abd21183
commit 0656c688ec
2 changed files with 38 additions and 15 deletions

View File

@@ -2,13 +2,23 @@ $(function () {
});
function saveStep1(e) {
var servermqtt = $("input[name='servermqtt']").val();
if (servermqtt === "") {
alert("Hãy nhập thông tin!");
return;
}
var url = $("input[name='url']").val();
if (url === "") {
alert("Hãy nhập thông tin!");
return;
}
common.modalBlock(true);
$.ajax({
url: $(e).attr("data-href"),
type: 'POST',
data: {
servermqtt: $("input[name='servermqtt']").val(),
url: $("input[name='url']").val()
servermqtt: servermqtt,
url: url
},
success: function (data) {
setInterval(function () {
@@ -16,8 +26,14 @@ function saveStep1(e) {
url: data,
type: 'POST',
success: function (data) {
if (data.status)
if (data.status) {
window.location = data.url;
} else {
if (data.text !== "") {
alert(data.text);
window.location.reload(true);
}
}
},
error: function (jqXHR, textStatus, errorThrown) {
common.ajaxError();