function loadScript(src, attrs = {}) { if (typeof document !== 'undefined') { const script = document.createElement('script') script.async = true script.defer = true Object.keys(attrs).forEach(attr => script.setAttribute(attr, attrs[attr])) script.src = src document.body.appendChild(script) } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter