WebSite X5Help Center

Nektarios K.
Nektarios K.

Html code for deferring js file  en

Autore: Nektarios K.
Visite 115, Followers 1, Condiviso 0  

hi there

I was trying to understand how I can deferring some js files.
In a 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


Postato il
Aleksej H.
Aleksej H.
Utente del mese RU

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.

Leggi di più
Postato il da Aleksej H.
Nektarios K.
Nektarios K.

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?



Leggi di più
Postato il da Nektarios K.
Stefano G.

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


Leggi di più
Postato il da Stefano G.