Check the Readiness of the DOM Structure with BX24.isReady

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
BX24.isReady(): boolean;
        

The BX24.isReady method immediately reports whether the document DOM structure is ready: the browser has parsed the application page, and its elements are accessible to the script. If your code needs to wait until the page is ready, use BX24.ready.

This is the library's flag, not the browser's. If the library is loaded programmatically rather than through a <script> tag in the markup, the method may return false on a page that has already been parsed. Page readiness does not mean that the library has received data from Bitrix24: for that, use BX24.init.

The method works on an application page where the BX24.js library is connected and does not call Bitrix24. The method requires no scope of its own.

Method Parameters

No parameters.

Code Example

How to Use Examples in Documentation

The script is placed in the page markup and runs while the browser is parsing the page:

<script>
            console.log(BX24.isReady()); // false: the browser is still parsing the page
        
            BX24.ready(function () {
                console.log(BX24.isReady()); // true
            });
        </script>
        

Response Handling

The method synchronously returns a result of type boolean. Example of the result when the page is ready:

true
        

Returned Data

Name
type

Description

result
boolean

true if the library has recorded that the document DOM structure is ready, otherwise false

Error Handling

The method does not return error codes. While the browser is parsing the page, the method returns false, and this is not an error.

Continue Your Learning