Open the Popup Window BX24.openApplication
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
The method BX24.openApplication opens a popup window with an application frame. You can pass parameters and a close handler to the application being opened.
void BX24.openApplication([Object params], [Function closeCallback], [Object settings])
Parameters
|
Name |
Description |
|
params |
An object of parameters that will be passed to the opened application |
|
closeCallback |
A function that will be called after the popup window is closed |
|
settings |
Additional window settings. Keys from |
Settings Parameter
|
Name |
Description |
|
width |
Width of the slider. Passed as |
|
label |
Parameters for the label. Passed as |
|
title |
Page title. Passed as |
|
leftBoundary |
Left margin of the slider. Passed as |
In some contexts of opening the window, the parameters
bx24_label.bgColorandbx24_label.textmay not apply. Meanwhile,bx24_label.colormay affect the color of the window's interface elements, such as the close icon.
Code Example
How to Use Examples in Documentation
A unified example for BX24.openApplication and BX24.closeApplication:
<script src="//api.bitrix24.com/api/v1/"></script>
<?
$placementOptions = array();
if (array_key_exists('PLACEMENT_OPTIONS', $_REQUEST))
{
$placementOptions = json_decode($_REQUEST['PLACEMENT_OPTIONS'], true);
}
if (!isset($placementOptions['opened']))
{
?>
<span onclick="openApplication()">Open</span>
<?
}
else
{
?>
<span onclick="closeApplication()">Close</span>
<?
}
?>
<script>
function openApplication()
{
BX24.openApplication(
{
opened: true
},
function()
{
alert('Application closed!');
}
);
setTimeout(closeApplication, 15000);
}
function closeApplication()
{
BX24.closeApplication();
}
</script>
Slider Example
BX24.openApplication(
{ opened: true },
function () {
console.log('Application closed');
},
{
width: 450,
label: {
bgColor: 'pink',
text: 'my task',
color: '#07ff0e'
},
title: 'my title'
}
);
Response Handling
The method does not return data (void).