Append cache-buster to dynamically loaded scripts
authorColeman Watts <coleman@civicrm.org>
Sat, 9 Feb 2019 02:54:20 +0000 (21:54 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 9 Feb 2019 03:46:27 +0000 (22:46 -0500)
js/Common.js

index de326cda0e367aa6c7e91e8e0b2eb82e5e5f899a..01bc7572bafafb6584569009a525cefb8c61c8a1 100644 (file)
@@ -256,7 +256,7 @@ if (!CRM.vars) CRM.vars = {};
         CRM.CMSjQuery = window.jQuery;
         window.jQuery = CRM.$;
       }
-      script.src = url;
+      script.src = url + (_.includes(url, '?') ? '&r=' : '?r=') + CRM.config.resourceCacheCode;
       document.getElementsByTagName("head")[0].appendChild(script);
     }
     return scriptsLoaded[url];