Load the javascript file BX24.loadScript

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

The method BX24.loadScript loads and executes one or more javascript files. If an array is provided, the files are loaded sequentially. If the DOM is not yet ready, meaning the page has not been parsed by the browser and elements are not yet available for the script, execution is deferred until BX24.ready.

void BX24.loadScript(Array|String script[, Function callback])
        

Parameters

Required parameters are marked with *

Name
type

Description

script*
array|string

Path to the javascript file or an array of paths. When an array is provided, the files are loaded and executed in order

callback
function

A callback function that is executed after all files have been loaded

Code Example

How to Use Examples in Documentation

BX24.loadScript(
            [
                '/local/scripts/first.js',
                '/local/scripts/second.js'
            ],
            function () {
                console.log('All scripts have been loaded');
            }
        );
        

Response Handling

The method does not return data (void).

Continue Learning