defer loading of javascript
-
Hello world
How to use these code below and where I must put these code ? :<script type="text/javascript"> // Add a script element as a child of the body function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "deferredfunctions.js"; document.body.appendChild(element); } // Check for browser support of event handling capability if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script>
I got that code from link below :
https://developers.google.com/speed/docs/best-practices/payload#DeferLoadingJSI have trouble with this issue like this https://developers.google.com/speed/pagespeed/insights#url=www.propertypilihan.com&mobile=false&rule=DeferParsingJavaScript
Can anyone help me ?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘defer loading of javascript’ is closed to new replies.