Closed (fixed)
Project:
Advanced CSS/JS Aggregation
Version:
7.x-2.26
Component:
Modifier
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Aug 2017 at 14:22 UTC
Updated:
15 Sep 2017 at 01:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mikeytown2 commentedTo get js files to be grouped together you need to use hook_js_alter and adjust the weights of the js files so they are the same yet different than the default.
To make js not render blocking use the modifier sub modules defer js option.
Comment #3
oppure commentedHi
thank you for your help. I've used the following code in a custo module
unfortunately it doesn't work as ajax.js is still put in a different aggregate than the other 3.
I can't use the defer option as it break the website.
What can I try to find out why it doesn't work?
Thank you.
Comment #4
mikeytown2 commentedThat's all core js and it's defer safe. How does your js break? Console errors?
Comment #5
oppure commentedok thanks,
I guess the problem is that I cannot select which files to defer, when I select defer all javascript is deferred and some things break on the website. e.g.facets don't collapse, forms text wysiwyg editor doesn't render and so on
Comment #6
mikeytown2 commentedHow to view the browser console:
Firefox/Chrome: press Ctrl + Shift + J.
Other browsers see: https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Er... (just ignore the first section)
You can also save the complete webpage as a zip file, the saved state will contain the js errors
http://www.makeuseof.com/tag/save-complete-webpage-offline-reading/
Comment #7
mikeytown2 commentedWere you able to fix the issue you where having with your JS? Should this issue be closed?
Comment #8
oppure commentedHot completely, deferring javascript brakes google ads on some browsers, I have to look better into this, but if you like close it, I will update in case I need. Thank you again.
Comment #9
mikeytown2 commentedIn terms of ads, you need to use the async version of them. https://support.google.com/dfp_premium/answer/1638622
Last time I checked https://www.drupal.org/project/dfp didn't use async, it might now though.
Comment #10
mikeytown2 commentedComment #11
oppure commentedThank you very much for your help. I'm using async code as in this page https://support.google.com/adsense/answer/3221666?hl=en
anyway the ads still don't display on random pages in all browsers when I use:
Every time I flush browser cache the first page I load always display ads, most pages loaded after the first one randomly don't display ads, I will update when I figure out the reason.
Comment #12
oppure commentedIt seems that what was breaking my google adsense was the wrapper function that was put around the adsense inline code
(adsbygoogle=window.adsbygoogle||[]).push({});I've added
$inline_js_defer_skip_list[] = 'adsbygoogle';and$inline_js_wrap_skip_list[] = 'adsbygoogle';in advag_mod.module and now I have the ads displaying correctly.I've also noticed the following code in
which suggests that google analytics code should not be wrpped as well. I have the analytics module installed but I noticed that the analytics inline code
window.google_analytics_domain_name = ".domainname.com";window.google_analytics_uacct = "UA-XXXXXXXXX";doesn't contain any of those strings indeed it's still wrapped by advagg.Comment #13
mikeytown2 commentedThanks for looking into this! I've moved things around a little bit and added in your changes to the lists.
Comment #15
mikeytown2 commented