update 4page
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Loads adl-register.section.html into a container.
|
||||
*/
|
||||
(function () {
|
||||
var MODULE_URL = '/pages/modules/adl-register.section.html';
|
||||
|
||||
function loadAdlRegisterModule() {
|
||||
var container = document.getElementById('adl-register-container');
|
||||
if (!container) return;
|
||||
|
||||
fetch(MODULE_URL, { credentials: 'same-origin' })
|
||||
.then(function (res) {
|
||||
if (!res.ok) throw new Error('Failed to load ' + MODULE_URL);
|
||||
return res.text();
|
||||
})
|
||||
.then(function (html) {
|
||||
container.innerHTML = html;
|
||||
document.dispatchEvent(new CustomEvent('aifo:adl-register-ready'));
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error('[adl-register-module.js]', err);
|
||||
});
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', loadAdlRegisterModule);
|
||||
} else {
|
||||
loadAdlRegisterModule();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user