<!-- wp:image {"align":"center","id":125,"width":768,"height":402,"sizeSlug":"large","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img src="https://www.mojoin.com/wp-content/uploads/2020/12/call-js-content-loaded-1024x536.jpg" alt="call js after content loaded" class="wp-image-125" width="768" height="402"/><figcaption>call JavaScript after content loaded</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>when we try to customize a Shopify product , collection or check-out page, most of cases we need to implement special features with JavaScript.  For example show most favourite products in product page or in check-out page, we need to write some JavaScript function to do some changes in your DOM object after all the pages content loaded.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">document.addEventListener('DOMContentLoaded', function() {
// your code here
},false)</pre>
<!-- /wp:enlighter/codeblock -->