How to connect the scripts in the admin bitrix?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
6 views
All of Privet.

Write a small module that is experiencing the problem.
On the page of the module connect the script method:
CJSCore::RegisterExt('partner_css_and_js', array( 'js' => array( '/bitrix/js/partner.module/scripts.js', ), 'css' => array( '/bitrix/css/partner.module/jquery.qtip.min.css', ), 'lang' => $rootFolder . '/lang/ru/admin_js.php', 'rel' => array('jquery') )); CJSCore::Init(array("partner_css_and_js"));


All well connected, but there was a need to declare a variable before plugin js scripts.
var adminParams = [...];


In this variable an array of values to be generated.

Tried using $APPLICATION->AddHeadString() but still displays after connecting the script.

Or how can I move the connect js in the admin panel in the footer?
by | 6 views

1 Answer

0 like 0 dislike
Not zavyazalas on a global scope and the execution order of the page.
Are you trying to do povnovazhennya things: a variable and a script that works with her, while the script to make the extension.

If You want to work with the extension, then use another paradigm: in. js file extensions store classes, and on page initialize the objects with parameters.

Want to know more? View components sale.order.ajax or sale.basket.basket
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
35,574 users