WebSite X5Help Center

 
Nektarios K.
Nektarios K.
User

Html code for deferring js file  en

Author: Nektarios K.
Visited 744, Followers 1, Shared 0  

hi there

I was trying to understand how I can deferring some js files.
In a vary.com/tools i found the code placed in my HTML just before the tag
I use both the option with connected and without a connected file (you can see my remark in a photo)
but the results are the same google and another tester still shows me the specific js file need to defer.
Kindly request your advice to this way of I follow and defer the js file

Thanks, and Regards

Nek

https://www.mieconsultancy.com

Posted on the
3 ANSWERS
Aleksej H.
Aleksej H.
Moderator

Hello.When I needed to implement what you want, as well as other optimization methods, I used the PageSpeed Module module on my hosting.

The module allows:

  • Combine all JavaScript into one file.
  • Combine all CSS styles in one file.
  • Move CSS styles before JavaScript scripts.
  • Preliminary rezolving of DNS.
  • Minimize JavaScript.
  • Minimize CSS.
  • Optimize the CSS in style attribute.
  • Deferred loading of images.Combine gaps. 
  • Move CSS to a head.
  • Remove unnecessary quotation marks.
  • Move small external CSS to HTML.
  • Move small external JavaScript into HTML.
  • Optimize URL in href and src attributes.
  • Coordinate META tags with HTTP headers.
  • Enable caching of images.
  • Enable caching of JavaScript.
  • Enable caching of CSS.

and other possibilities ...

More information is available here.

Read more
Posted on the from Aleksej H.
Nektarios K.
Nektarios K.
User
Author

Dear Aleksj,

Unfortunately, my provider does not support the speed module and I looking for an alternative method for deferring some js and css if possible.

Any possibility of that?

Rgds,

Nek

Read more
Posted on the from Nektarios K.
Incomedia
Stefano G.
Incomedia

Hello Nektarios

Unfortunately, such codes go beyond the scope of what the Official support can help you with

For matters such as these, you will need to wait for other users to join the conversation and eventually help you out with this

I will however remain available should you have any further questions about the software

Thank you

Stefano

Read more
Posted on the from Stefano G.