Application initialization
Tripous waits until the browser has completed the document initialization cycle before running application startup callbacks. This means application code can safely find elements, create controls, attach event handlers, and initialize page state.
The usual entry point is tp.Ready(). A page may also define tp.Main();
when present, it is called after the ready callbacks. The two application hooks shown here are
available for framework-level startup work before and after the ready callbacks.
Startup shape
tp.AppInitializeBefore = function () {
// Optional framework-level setup.
};
tp.Ready(function () {
// Normal page/application setup.
// Use as many tp.Ready() callbacks as needed.
});
tp.AppInitializeAfter = function () {
// Optional framework-level setup after ready callbacks.
});
tp.Main = function () {
// Optional final startup entry point.
};
Most page code belongs in tp.Ready(). Use tp.Main() only
when a page or application wants a single final startup function.
Observed order
tp.AppInitializeBefore()runs before ready callbacks.tp.Ready()callbacks run when the page is ready.tp.AppInitializeAfter()runs after ready callbacks.tp.Main()runs last when defined.