Ministry of Technology
Show Menu

JavaScript On Load Function Stack

JavaScript On Load Function Stack
Created by Ministry
Language
JavaScript (ES5)
Type
Web

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.

Usage 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")
Visit us on GitHub