S
S
Simon Tis2019-10-03 19:03:22
PHP
Simon Tis, 2019-10-03 19:03:22

How all the same to connect a script in header 1C?

A banal task is to connect a js script to the head of a 1C site.
What I did:
in header.php I
added
<?$APPLICATION->AddHeadScript('/bitrix/js/formsrc.js')?> // this is my script
Doesn't work. Climbed into the console - I see the following picture
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("");
?>
$(document).ready(function(){
console.log('test');
})<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
http screenshot :
// joxi.ru/EA4PVVzco4OlVA Bitrix arbitrarily added
<?
require($_SERVER["DOCUMENT_ROOT"]."
in my script, which is why it is not executed.
Tell me, please, how to be and correctly add the script?
If you add vlob, stupidly in the tag in header.php - it works, but it doesn't seem to be kosher.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tempick, 2018-06-16
@tempick

$params = json_decode(тут переменная , в которой json-строка);
$amount = $params -> accounts[1] -> balance -> amount;

A
Alexander, 2019-10-03
@simon91

Bitrix did not spontaneously add anything. You took this and for some reason created a script as a page of the site.
Use the code editor or edit the file from the admin panel in PHP mode - the item "Edit as PHP"

J
Jupiter Max, 2019-10-03
@vardoLP

what's the difference? connected, it works. All.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question