Remember me

Specific error with code editor js

1 year 4 months ago #1

  • Alexander's Avatar
  • Alexander
  • Posts: 319
works.weston.alexander-drobakhin.com/cal.../dushova-kabina-wk-3

I recently encountered a bug in the custom html plugin. I wrote new code, also wrote scripts that worked with this code, then I deleted the script, but the code on the site worked as if I did not delete the script. Pretty funny and absurd situation. It seems like a banal cache or just missed something. I still can’t find what’s wrong and blocked this code with a new one.

But today I ran into this again in a different place

I will describe in detail the course of my actions

Form component - js code editor

i wrote this code
$(".calc-section-base-img > .ba-overlay").append('<div class="calc-backg-sklo"></div>').append('<div class="calc -backg-furniture"></div>').append('<div class="calc-backg-mat"></div>').append('<div class="calc-backg-ruchka"> </div>');

it works well, then in my old script I added the ability to change the class attribute for the code above when the form settings change. Works good.

Then I tested the image settings and in the site settings I turned on lazy loading, then turned it off (although most likely this is not related to the problem, it may just have coincided). It's just that my actions were in that order.

After that, I notice that the site code looks wrong, the code is duplicated

It was
<div class="ba-overlay">
<div class="calc-backg-sklo-1"></div>
<div class="calc-backg-furniture-1"></div>
<div class="calc-backg-mat-1"></div>
<div class="calc-backg-ruchka-1"></div>
</div>
It became
<div class="ba-overlay">
<div class="calc-backg-sklo-1"></div>
<div class="calc-backg-furniture-1"></div>
<div class="calc-backg-mat-1"></div>
<div class="calc-backg-ruchka-1"></div>
<div class="calc-backg-sklo"></div>
<div class="calc-backg-furniture"></div>
<div class="calc-backg-mat"></div>
<div class="calc-backg-ruchka"></div>
</div>


I started checking the code, but I can't find any errors. Everything is exactly the same as when everything worked well.

And the most interesting))
I delete this code, clear the cache
$(".calc-section-base-img > .ba-overlay").append('<div class="calc-backg-sklo"></div>').append('<div class="calc -backg-furniture"></div>').append('<div class="calc-backg-mat"></div>').append('<div class="calc-backg-ruchka"> </div>');
but it continues to load on the page(not this code, but the result of its work i.e. there is no code anymore, but it is executed somehow)

Real Magic

The investigation begins, I try to find this code on the site, for convenience I combine all the js, but it is not on the site, not in html, not in js files

As a result, I found the answer in the database, this code was saved along with the page on which the form was added. those. it has become static code, updating the form or deleting the problem does not solve the problem, only deleting the entire section and creating it again, which is not a solution to the problem.

when I first encountered the problem it was a banal addClass("active") which became part of the page, even after removing my code

Эту часть продублирую в оригинале, чтобы было понятнее))

(В итоге ответ я нашел в базе данных, этот код сохранился вместе со страницей на которую была добавлена форма. т.е. он стал статическим кодом, частью гридбокса, а не динамически добавляемым элементом при загрузке. Обновление формы или удаление и добавление заново проблему не решает, только удаление всей секции и создание заново, что не есть решением проблемы.)

1 year 4 months ago #2

  • Viacheslav's Avatar
  • Viacheslav
  • Posts: 28858
Hello,
Thank you for contacting us

You can try to add your code to joomla module
and add it to the page using joomla module plugin

Regards,
Vyacheslav, Balbooa.com
Powered by Kunena Forum