, пожалуйста, помогите мне выйти из этой проблемы. Когда я запускаю следующий код запроса ajax, чтобы заполнить поле выбора в зависимости от выбора пользователем первого поля выбора:
$("#item_type").change(function () {
var item_type = $("#item_type").val();
if(item_type == "spare_parts")
{
$.ajax({
type: "GET",
url: "http://example.com/index.php/inventory/spend_receive_receipt/get_items/",
dataType: 'json',
success: function (data) {
var Areas = data.length;
elements = "<option value='0'>إختر الصنف</option>";
for (var i = 0; i < Areas; i++) {
elements += "<option value='" + data[i]['id'] + "'>" + data[i]['item_name'] + "</option>";
};
elements_label = "الأصناف";
$("#items_devices").html(elements);
// $("#items_devices_label").html(elements_label);
};
error: function (req, err) {
console.log("my message : " + err);
};
});
}else if (item_type == "devices")
{
$.ajax({
type: "GET",
url: "http://example.com/index.php/inventory/spend_receive_receipt/get_devices/"
dataType: "json",
success: function (data) {
var Areas = data.length;
elements = "<option value='0'>إختر الجهاز</option>";
for (var i = 0; i < Areas; i++) {
elements += "<option value='" + data[i]['id'] + "'>" + data[i]["device_name"] + "</option>";
}
elements_label = "الأجهزة";
$("#items_devices").html(elements);
// $("#items_devices_label").html(elements_label);
}
error: function (req, err) {
console.log("my message : " + err);
};
});
}
});
Я получил следующую ошибку в consolи запрос не был выполнен
Uncaught TypeError: Cannot redefine property: BetterJsPop
at Function.defineProperty (<anonymous>)
at inject (<anonymous>:20:10)
at <anonymous>:510:11
at <anonymous>:511:11
и это
Uncaught TypeError: Cannot set property 'innerHTML' of null
at new countUp (countUp.min.js:1)
at autoUpdateNumber (dashboard.js:2)
at HTMLDocument.<anonymous> (dashboard.js:1)
at j (jquery-1.11.min.js:776)
at Object.fireWith [as resolveWith] (jquery-1.11.min.js:810)
любая помощь будет оценена.