Documentation

BX24.install

void BX24.install(Function callback)

void BX24.install(String callback)

Use this method to set a callback function that will be called when an application is being run for the first time for a current user. The event fires as soon as the library is initialized and ready but before calling the initialization callback function set by BX24.init.

The callback function has to notify the system that installation is complete by calling BX24.installFinish.

If the callback is a string constant, it will be treated as an URL to a .js file that will be loaded and executed once the event is fired.

If the string is passed as handler, then it is considered as link to JS-file, which should be loaded and executed when event is initiated. In any case, if a current user runs the application for the first time and there is at least one install callback, BX24.init callbacks will be called no sooner than BX24.installFinish is called.

Example

BX24.install(function(){
	BX24.callMethod('user.current', {}, function(res){
		alert('Greetings from my Hello World App, ' + res.data().NAME + '!');
		BX24.installFinish();
	});
});



© «Bitrix24», 2001-2024
Up