Hello,
I am receiving this error message while trying to process the following javascript - "Error, the configuration is failed to save".
What might be wrong? How to troubleshoot the javascript?
partial/setting.blade.php
function onSave(el) {
var parent = $(el).closest("li");
var form = $(parent).find("form");
var editel = $(parent).find(".edit_form");
var beforeText = $(parent).find(".setting-nav2").html();
var options = {
beforeSubmit: function () {
var parent = $(el).closest("li");
var loading_gif = "<img width='24px' src='{{url('')}}/images/loading.gif'/>"
$(parent).find(".setting-nav2").html(loading_gif);
},
success: function (data) {
$(editel).find("strong").html(data.message);
cancel(parent);
pesanOk("Configuration is saved successfully");
},
error: function (data) {
try {
var message = JSON.parse(data.responseText);
if (message.message != "") {
pesanErr(message.message);
} else pesanErr("Error, the configuration is failed to save");
} catch (ec) {
console.log(data);
pesanErr("Error, the configuration is failed to save");
}
$(parent).find(".setting-nav2").html(beforeText);
}
};
$(form).ajaxSubmit(options);
}