Tag: Enterprise solution

  • Why Does Enterprise Ecommerce Business Need To Go Headless?

    Why Does Enterprise Ecommerce Business Need To Go Headless?

    Well, for starters, the best enterprise ecommerce business platform should have lots of features that are seamlessly inbuilt and do not require plugins or extensions to run the whole system. Also, the enterprise ecommerce platform should be flexible enough to accommodate your unique flows and business requirements. The platform should also be scalable to support…

document.addEventListener('DOMContentLoaded', function() { // Check if the current URL matches the format for a single post page var isSinglePostPage = window.location.pathname.match(/\/([^/]+)\/$/); // If it's a single post page, preload the featured image and remove lazy loading from it if (isSinglePostPage) { var postFeaturedImage = document.querySelector('.wp-block-group .wp-block-post-featured-image .wp-post-image'); if (postFeaturedImage) { var imageUrl = postFeaturedImage.getAttribute('src'); var preloadLink = document.createElement('link'); preloadLink.rel = 'preload'; preloadLink.href = imageUrl; preloadLink.as = 'image'; document.head.appendChild(preloadLink); // Remove lazy loading attribute from the featured image postFeaturedImage.removeAttribute('loading'); } } // Lazy load all other images const images = document.querySelectorAll('img'); images.forEach(img => { // Check if the image is not the featured image if (img !== postFeaturedImage) { // Append lazy loading attribute to each tag except the featured image img.setAttribute('loading', 'lazy'); } }); });