reinitializer.handle(false);

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2023-10-06 19:27:47 +07:00
parent c788e7939d
commit fed3fd9539

View File

@ -7,15 +7,17 @@ Used when developing any dynamic requests via JS where links to third-party docu
# Instruction # Instruction
By default, the library is observe the first `<main>` element, but you can reassign it by passing an argument of type `{HTMLElement|null}` to `new e.detail.reinitializer();` By default, the library is observe the first `<main>` element, but you can reassign it by passing an argument of type `{HTMLElement|null}` to `new e.detail.reinitializer();`
document.addEventListener('reinitializer.initialized', function (e) {
// Initialized reinitializer
document.addEventListener('reinitializer.initialized', function (e) { // Initialize of instance of reinitializer
// Initialized reinitializer const reinitializer = new e.detail.reinitializer();
// Initialize of instance of reinitializer // First reinitialization with prevented downloading
const reinitializer = new e.detail.reinitializer(); reinitializer.handle(false);
// Start observation // Start observation
reinitializer.start(); reinitializer.start();
}); });
By default, after reinitialization, `<link>` elements are moved to the end of the `<head>` element, and `<script>` elements are moved to the end of the `<body>` element. You can override this behavior by changing the `reinitializer.js` and `reinitializer.css` properties. By default, after reinitialization, `<link>` elements are moved to the end of the `<head>` element, and `<script>` elements are moved to the end of the `<body>` element. You can override this behavior by changing the `reinitializer.js` and `reinitializer.css` properties.