Will this module help me lazyload external js scripts?

I am using modules that call external js scripts like facebook or google maps.

Sometimes this seems to hang and stops my entire site from loading.

Is there a way around this?

Comments

mikeytown2’s picture

This is related to #2119047: Bundle external resources
External JS causing local issue and ways to work around it.

mikeytown2’s picture

Couple of options:
- Use something like https://drupal.org/project/labjs
- Alter the drupal js and set the async or defer attribute (only works if using AdvAgg)
- Store the external resource locally

The advagg_mod submodule has an experimental option for making all JS have the defer tag; on the admin/config/development/performance/advagg/mod page under "Add the defer tag to all script tags". It sets the defer key to TRUE and does some onload tricks to make sure things still work as they should.

mikeytown2’s picture

Status: Active » Closed (duplicate)