Сразу скажу, что я далёк от программированияобратитесь к специалисту.
if (window.NodeList && !NodeList.prototype.forEachReverse) {
NodeList.prototype.forEachReverse = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = this.length; i--;) {
callback.call(thisArg, this[i], i, this);
}
};
}
document.querySelectorAll('span.foo').forEachReverse(function(e) {
e.outerHTML = '[e]' + e.outerHTML + '[/e]';
});
var myBigData = [1, 2, 3, ...., 10000]; // ваш набор данных в удобном вам виде
$.post('/my/super/route.php', { data: JSON.stringify(myBigData)}, function(resp) {
console.log(resp);
});
$myBigData= json_decode($_POST['data']);
<?php
function declOfNum($number, $titles)
{
$cases = array (2, 0, 1, 1, 1, 2);
return $titles[ ($number%100 > 4 && $number %100 < 20) ? 2 : $cases[min($number%10, 5)] ];
}
$titles = ['ответ','ответа','ответов'];
$fields['answers'] = qa_format_number($post['acount'], 0, true) . ' '. declOfNum((int)$post['acount'], $titles);
export const isMobile = () => {
return !!(navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
)
};