Object.keys(
$('.qq-upload-list .qq-upload-file').get()
.reduce((acc, curr) => ({...acc, [curr.textContent]: 1}), {})
).length;
function unique(data, key = n => n) {
const getKey = key instanceof Function ? key : n => n[key];
const keys = new Set;
const result = [];
for (const n of data) {
const k = getKey(n);
!keys.has(k) && keys.add(k) && result.push(n);
}
return result;
}const uniqueCount = unique(
document.querySelectorAll('.qq-upload-list .qq-upload-file'),
n => n.innerText
).length;Скрипт каждую секунду проверяет...
(new MutationObserver(([ { target } ]) => {
document.querySelector('.countfiles').textContent = unique(
target.getElementsByClassName('qq-upload-file'),
'textContent'
).length;
})).observe(
document.querySelector('.qq-upload-list'),
{ childList: true }
); .data('src', ...);.append($big = $('<img />').attr('src', $this.attr($this.is('img') ? 'data-src' : 'href')).css('position', 'absolute')) $('.comics img').each(function() {
$(this).attr('data-src', 'new data-src value');
});$('.comics img').each(function() {
let src = $(this).attr('data-src');
$(this).attr('data-src', src.replace('https://domain.ru', 'https://anotherdomain.ru/blabla/blabla/'));
}); <?
global $USER;
$APPLICATION->IncludeComponent("kupitrix:form.support", "contact_form", Array(
"EMAIL_TO" => "info@.ru", // E-mail, на который будет отправлено письмо
"EVENT_MESSAGE_ID" => array( // Почтовые шаблоны для отправки письма
0 => "7",
),
"OK_TEXT" => "Спасибо, ваше сообщение принято.", // Сообщение, выводимое пользователю после отправки
"REQUIRED_FIELDS" => array( // Обязательные поля для заполнения
0 => "NAME",
1 => "EMAIL",
2 => "MESSAGE",
),
"USE_CAPTCHA" => "Y", // Использовать защиту от автоматических сообщений (CAPTCHA) для неавторизованных пользователей
),
false,
array(
'ACTIVE_COMPONENT' => $USER->IsAuthorized() ? 'Y':'N'
)
);?>echo round(8.154, 1); //8.2echo substr("8.154", 0, 3); //8.1<script type="text/javascript">$.get('/php/user_mn/index.php?n='+encodeURIComponent(document.title));</script>
$.each( data, function( key, val ) {
html += '<a href="ссылка' +val.nameEN+ '">' +val.nameEN+ '</a>';
});
$.getJSON('ССЫЛКА',{},function (data) {
var html = '';
data.gallery.kadr.forEach(function(element) {
html += '<img src="ссылка' + element.image + '">';
})
document.getElementById("kadri").innerHTML=html;
}); <script>
var idItsRead = document.getElementById('idItsRead');
function onclickItsRead() {
idItsRead.style.color = (idItsRead.style.color == 'red') ? '' : 'red';
localStorage.setItem('ReadCom' + location.pathname, idItsRead.style.color);
}
if(localStorage.getItem('ReadCom' + location.pathname) == 'red') {
document.getElementById('idItsRead').style.color= 'red';
}
</script> $(window).load(function()...$(document).ready(function()...this.src=url+this.getAttribute('orig-url');this.src=this.getAttribute('orig-url').replace('http://comicsonline.ru/', url);(c href аналогично)if (!mkdir(""./1/dcearth2/008/"", 0777, true)) {
die('Failed to create folders...');
}