This commit is contained in:
parent
2588e7ae9e
commit
45cb5cec04
5 changed files with 34 additions and 13 deletions
|
|
@ -62,13 +62,17 @@
|
|||
app = isMobile ? 'mobile' : 'desktop';
|
||||
}
|
||||
|
||||
// Script version
|
||||
const ver = localStorage.getItem('v') || VERSION;
|
||||
|
||||
// Whether use raw version script
|
||||
const raw = localStorage.getItem('useRawScript') == 'true';
|
||||
|
||||
// Load an app script
|
||||
// Note: 'async' make it possible to load the script asyncly.
|
||||
// 'defer' make it possible to run the script when the dom loaded.
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', `/assets/${app}.${ver}.${lang}.js`);
|
||||
script.setAttribute('src', `/assets/${app}.${ver}.${lang}.${raw ? 'raw' : 'min'}.js`);
|
||||
script.setAttribute('async', 'true');
|
||||
script.setAttribute('defer', 'true');
|
||||
head.appendChild(script);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue