Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedThis is related to #2119047: Bundle external resources
External JS causing local issue and ways to work around it.
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedCouple 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.Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedMoving this issue
#2149321: Create a submodule allowing one to modify every CSS & JS asset