Defer Code in Widgets – Page Speed

Your code shows an inline script, which adds a new script tag to the DOM, which probably slows down your website’s loading time. This is not an inline script tag then. Try adding this line s.defer = true; after s.async = true; to add the defer attribute to your script tag. It should then look like this:

var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.defer = true; //add this line
var theUrl = baseUrl+'serve/v1/coin/multi?fsyms=BTC,LBC,ETH&tsyms=USD,BTC,GBP,CNY';
s.src = theUrl + ( theUrl.indexOf("?") >= 0 ? "&" : "?") + "app=" + appName;
embedder.parentNode.appendChild(s);

This should result in adding a new script tag (named s in your code) to all the scripts the page will load and it should look like this:

<script type="text/javascript" async defer src="https://widgets.cryptocompare.com/serve/v1/coin/multi?fsyms=BTC,LBC,ETH&amp;tsyms=USD,BTC,GBP,CNY"></script>