D
D
Danil Namaste2019-06-03 18:17:07
JavaScript
Danil Namaste, 2019-06-03 18:17:07

How to add a script to Bitrix crm?

You need to change the numbers to text, using js, I wrote the code, but I don’t know where to stick it. 590fbd3344.jpg

https://b24-y68x8f.bitrix24.ru/stream/

the code is

$(document).ready(function() {
    String.prototype.replaceAll = function(s1, s2) {
      return this.replace(
          new RegExp(  s1.replace(/[.^$*+?()[{\|]/g, '\\$&'),  'g'  ),
          s2
      );
  };

  var e = $("span"),
      fix = e.html().replaceAll('74991105297', "Текст1");
  e.html(fix);
});


Tell me where to look for the js or php file where to insert this code so that it works.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anyzeke, 2019-06-04
@anyzeke

In local/php_interface/init.php

<?
use Bitrix\Main\Page\Asset;

CJSCore::Init(array("jquery" ));

$oAsset = Asset::getInstance();
$oAsset->addJs('тут_путь_к_вашем_скрипту_относительно_DOCUMENT_ROOT', true);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question