API Methods
1. oLoader()
Creates an instance of oLoader.
const app = oLoader();
2. body(file, option)
Loads an HTML file into the body. The option
parameter can be e
(end) or b
(beginning).
app.body('index.html', 'b');
3. head(file, option)
Loads content into the head section.
app.head('header.html', 'e');
4. script(file, target)
Loads a script dynamically. The target
can be head
or body
.
app.script('./script.js', 'body');
5. beforeLoad(callback)
Executes a function before loading content.
app.beforeLoad(() => console.log("Loading..."));
6. load(callback)
Executes the loading process.
app.load(() => console.log("Content Loaded"));