This project provides a single function that enables you to stack code into the window onload event so that various functions can all be executed in order.
npm install onload-function-stackUsage examples to show two dialog messages in turn when used as a package reference...
var stackManager = require("onload-function-stack")
var myFunc = function(msg) {
alert(msg)
}
stackManager.add(myFunc, "Hello")
stackManager.add(myFunc, "Hello Again")
or if used as a straight reference, it's available on the window object...
var myFunc = function(msg) {
alert(msg)
}
window.OnLoadStack.add(myFunc, "Hello")
window.OnLoadStack.add(myFunc, "Hello Again")
* https://github.com/ministryotech
* https://github.com/tiefling
- NPM - https://www.npmjs.com/onload-function-stack