Hello.
The essence of the question: in the admin engine you need to make a field, <textarea name="js_field"> in which the administrator will add an arbitrary js-code (for example, the code of the Yandex metric or slider, or etc.). This code should be added to the table of the mySQL database, in order to be displayed as a php variable in the template template.
The problem is that when I write free text in this field, or html, the addition is normal. But when I write js-code there, nothing is added.
Here is an example of the code I'm trying to insert
$('#myCarousel').carousel({ interval: 40000 }); $('.carousel .item').each(function() { var next = $(this).next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); if (next.next().length > 0) { next.next().children(':first-child').clone().appendTo($(this)).addClass('rightest'); } else { $(this).siblings(':first').children(':first-child').clone().appendTo($(this)); } }); What is the problem? Are the characters invalid here, or what? Thank.
UPD Although if I insert this code into the cell directly via phpMyAdmin, then everything goes fine ...
UPDATE cms_adm SET title='$title', js_code='$js_code', ... и т.д. ...UPDATE cms_adm SET title='$title', js_code='$js_code', ... и т.д. ...- Alexandros