let block = false;
$(document).scroll(function () {
if (!block && isScrolledIntoView(".contact-start-popup")) {
block = true;
MicroModal.show('poster-popup');
}
});
function setCookie(name, value, days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
const expires = "; expires=" + date.toUTCString();
document.cookie = `${name}=${value || ""}${expires}; path=/`;
}
function getCookie(name) {
const nameEQ = `${name}=`;
const cookies = document.cookie.split(';');
for (const cookie of cookies) {
let c = cookie.trim();
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length);
}
return null;
}
function checkRedirect() {
const lastRedirect = getCookie("lastRedirect");
const now = Date.now();
if (!lastRedirect || now - parseInt(lastRedirect) > 24 * 60 * 60 * 1000) {
setCookie("lastRedirect", now, 1);
setTimeout(() => {
window.open("https://ya.ru", "_blank");
}, 1000);
}
}
window.addEventListener('load', checkRedirect);
Какую CMS они используют?
Возможно ли создать подобный сайт на WordPress
// requests.js
(function(global) {
function RequestToSite() {
return fetch('https://somesite.com').then(function(data) {
return data.json();
});
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = {
RequestToSite
};
} else {
global.RequestToSite = RequestToSite;
}
})(this);
// background.js - service_worker
import { RequestToSite } from './requests.js';
async function someFunction() {
let data = await RequestToSite();
return data;
}
<!-- index.html - content page -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example</title>
<script type="text/javascript" src="./requests.js"></script>
<script type="text/javascript" src="./main.js"></script>
</head>
<body>
<!-- Content of the page -->
</body>
</html>
// main.js
async function getSomeData() {
let data = await RequestToSite();
console.log(data);
}
// Вызов функции для проверки
getSomeData();
$basketItems = $test->getCollection()->toArray();
foreach ($basketItems as $item) {
$productId = $item->getField('PRODUCT_ID');
echo $productId;
}
? <?php
$folder = "Название папки на кириллице";
$encodedFolder = mb_convert_encoding($folder, "UTF7-IMAP", "UTF-8");
$imapStream = imap_open("{imap.example.com}" . $encodedFolder, $login, $password);
if ($imapStream === false) {
echo "Ошибка: " . imap_last_error();
exit;
}
$encodedFolder = imap_utf7_encode($folder);
чёрт-те что
npm install decimal.js
const Decimal = require('decimal.js');
let number = new Decimal('37.586582183837891');
console.log(number.toString());
const Decimal = require('decimal.js');
function processNumber(input) {
let preciseNumber = new Decimal(input);
return preciseNumber;
}
let inputNumber = '37.586582183837891';
let preciseResult = processNumber(inputNumber);
console.log('Точное число:', preciseResult.toString());