<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="<a href="script.js">
pagespeed on;
include bx/conf/pagespeed.conf;
pagespeed RewriteLevel CoreFilters;
\Bitrix\Main\UI\Extension::load("ui.vue");
\Bitrix\Main\UI\Extension::load("ui.vue.directives.lazyload");
<div id="images_list"></div>
<img
v-bx-lazyload
data-lazyload-src="<?=$arItem['PREVIEW_PICTURE']['SRC']?>"
data-lazyload-error-src="https://via.placeholder.com/300/FF0000"
src="https://via.placeholder.com/300"
alt="<?=$arItem['PREVIEW_PICTURE']['ALT']?>"
data-lazyload-dont-hide
/>
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8Vw8AAoEBfymqrywAAAAASUVORK5CYII="
BX.Vue.create({
el: '#images_list'
});
CJSCore::Init(array("jquery"));
$this->addExternalJS(SITE_TEMPLATE_PATH . "/js/lazyload.min.js");
<picture>
<source type="image/webp" data-srcset="<?=$arItem['PICTURE_WEBP']['WEBP_SRC']?>">
<source type="<?=$arItem['PICTURE_WEBP']['CONTENT_TYPE']?>" data-srcset="<?=$arItem['PICTURE_WEBP']['SRC']?>">
<img class="lazy" data-src="<?=$arItem['PICTURE_WEBP']['SRC']?>" alt="<?=$arItem['PICTURE_WEBP']['ALT']?>">
</picture>
$(document).ready(function() {
var lazyLoadInstance = new LazyLoad({
elements_selector: ".lazy"
});
});
<?
use Bitrix\Main\Page\Asset; // подключение css-стилей Asset::getInstance()->addCss("/bitrix/css/main/bootstrap.min.css"); // подключение js-скриптов Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/js/myscripts.js"); // подключение произвольных кусков кода (сторонних файлов) Asset::getInstance()->addString("<link rel='shortcut icon' href='/local/images/favicon.ico' />"); ?>
<?
$this->getTemplate()->addExternalCss("/local/addcss.css");
$this->getTemplate()->addExternalJs("/local/addcss.css");
?>
<link rel="stylesheet" href="/build/assets/styles/app.css"> — основные стили
echo '<meta http-equiv="Content-Type" content="text/html; charset='.LANG_CHARSET.'"'.(true? ' /':'').'>'."\n";
$APPLICATION->ShowMeta("robots", false, true);
$APPLICATION->ShowMeta("keywords", false, true);
$APPLICATION->ShowMeta("description", false, true);
$APPLICATION->ShowLink("canonical", null, true)
$APPLICATION->ShowCSS(true, true);
$APPLICATION->ShowHeadStrings();
$APPLICATION->ShowHeadScripts();
body {font-family: 'FirstFont', 'SecondFont', sans-serif;}
function loadScript(src) {
var s = document.createElement('script');
s.src = src;
document.body.appendChild(s)
}
setTimeout(function() { loadScript('/js/task24807.js') }, 2000);