configLoader.js 520 B

123456789101112131415161718
  1. if (!window.configLoadLoop) {
  2. window.configLoadLoop = setInterval(function () {
  3. if (window.configLoadLoop) {
  4. clearInterval(window.configLoadLoop)
  5. window.configLoadLoop = null
  6. }
  7. document.head.removeChild(document.getElementById('configJS'))
  8. setConfigJS()
  9. }, 60 * 100)
  10. }
  11. function setConfigJS () {
  12. const config = document.createElement('script')
  13. config.id = 'configJS'
  14. config.type = 'text/javascript'
  15. config.src = './config.js?t=' + Date.now()
  16. document.head.appendChild(config)
  17. }