JAVASCRIPT
Execute code only when the DOM is loaded.
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Function name | Description |
---|---|
.run([win], fn) | Specify a function to execute when the DOM is fully loaded. |
Specify a function to execute when the DOM is fully loaded.
win
windowWindow object to attach/add the eventfn
Callback function to be executed after the DOM is readyRun a function on DOMContentLoaded
AKA on DOM Ready
Should be used to run some code that will manipulate DOM in the page
Code
<html>
<head>
<script src="https://cdn.ink.sapo.pt/3.0.0/js/ink.js"></script>
<script>
Ink.requireModules(['Ink.Dom.Loaded_1'], function (DomLoaded) {
DomLoaded.run(function(){
alert('DOM is Ready');
// ...
});
});
</script>
</head>
<body>
</body>
</html>