При загрузке страницы вызываю
$(window).on('load', function() {
apiblock(1, 'all');
});
function apiblock(calc_day, all) {
$.ajax({
url: '/retail/apiblock.php',
method: 'get',
dataType: 'json',
data: {DAY: calc_day, ID_USER: id_retail, SHOP_ID: shop_id},
success: function(data){
if(all == 'all') {
$('#name_tock').html(data[shop_id].name_shop);
}else{
$('#salary_forecast').html(Math.round(data[shop_id].salary_forecast));
}
},
error: function (jqXHR, exception) {
if (jqXHR.status === 0) {
alert('Not connect. Verify Network.');
} else if (jqXHR.status == 404) {
alert('Requested page not found (404).');
} else if (jqXHR.status == 500) {
alert('Internal Server Error (500).');
} else if (exception === 'parsererror') {
alert('Requested JSON parse failed.');
} else if (exception === 'timeout') {
alert('Time out error.');
} else if (exception === 'abort') {
alert('Ajax request aborted.');
} else {
alert('Uncaught Error. ' + jqXHR.responseText);
}
}
});
}
Не на старых ios не работает не на новых, на десктопе все ок