-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic-catalog-data.html
More file actions
31 lines (26 loc) · 1.29 KB
/
dynamic-catalog-data.html
File metadata and controls
31 lines (26 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Работа с данными в динамическом каталоге Тильды
<!-- ********************************************************************** -->
<!-- Работа с данными в динамическом каталоге Тильды -->
<!-- ********************************************************************** -->
<script>
const MAX_ATTEMPTS = 10;
let attempts = 0;
function checkForJsStore() {
if (attempts >= MAX_ATTEMPTS) {
console.warn("Достигнуто максимальное количество попыток. Подождите или обновите страницу.");
return;
}
const element = document.querySelector('.js-store .js-store-prod-text, .t-store .js-store-prod-text');
if (element && element.children.length > 0) {
// Здесь будет код для "инжектирования" вашего контента, когда элемент найден
insertYourContent();
} else {
attempts++;
setTimeout(checkForJsStore, 1000);
}
}
function insertYourContent() {
// Здесь должна быть реализация функции, которая "инжектирует" ваш контент на страницу
}
checkForJsStore();
</script>