Web Page is ready when JET says it is
When you come, then its morning Is the web page really ready? This is the question I always have, and mostly all HTML page developers will have. This situation is specific when a JS code needs to be invoked on page load, or when the page is ready. Its so simple to determine the page's readiness in VBCS (actually its extended JET Framework). JET is a web application development framework, following the MVVM pattern and has a huge UI component library. So, during the page load, some framework internal APIs are still interacting with (or preparing the) UI components on the page, thus keeping the page busy. And any code which needs to be triggered, when the page is ready, should wait till the framework makes the page ready. So, how do we determine the page's ready state (or the busy state) in JET? Very Simple. Just use the out-of-the-box convenience APIs which tells if the page is busy. Let's have a look at the below code. define(['ojs/ojcore'], (oj) =...