projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #13640 from pradpnayak/notevalidation
[civicrm-core.git]
/
js
/
Common.js
diff --git
a/js/Common.js
b/js/Common.js
index c090e9ceefe2b2b9f9cfb66db8fc14474045bca5..ce8546c5708edf2e4cf03397d9332f54a00665ee 100644
(file)
--- a/
js/Common.js
+++ b/
js/Common.js
@@
-238,9
+238,13
@@
if (!CRM.vars) CRM.vars = {};
};
var scriptsLoaded = {};
};
var scriptsLoaded = {};
- CRM.loadScript = function(url) {
+ CRM.loadScript = function(url
, appendCacheCode
) {
if (!scriptsLoaded[url]) {
if (!scriptsLoaded[url]) {
- var script = document.createElement('script');
+ var script = document.createElement('script'),
+ src = url;
+ if (appendCacheCode !== false) {
+ src += (_.includes(url, '?') ? '&r=' : '?r=') + CRM.config.resourceCacheCode;
+ }
scriptsLoaded[url] = $.Deferred();
script.onload = function () {
// Give the script time to execute
scriptsLoaded[url] = $.Deferred();
script.onload = function () {
// Give the script time to execute
@@
-256,7
+260,7
@@
if (!CRM.vars) CRM.vars = {};
CRM.CMSjQuery = window.jQuery;
window.jQuery = CRM.$;
}
CRM.CMSjQuery = window.jQuery;
window.jQuery = CRM.$;
}
- script.src =
url + (_.includes(url, '?') ? '&r=' : '?r=') + CRM.config.resourceCacheCode
;
+ script.src =
src
;
document.getElementsByTagName("head")[0].appendChild(script);
}
return scriptsLoaded[url];
document.getElementsByTagName("head")[0].appendChild(script);
}
return scriptsLoaded[url];