Good day.

I'm trying to download content on ajax, there is no knowledge of ajax, but I want to figure it out, probably tell me where to look. It's not entirely clear, there are 2 divas, content is unloaded into one in the second sidebar, in the sidebar menu, content is loaded by the Ajax, they clicked on the menu in the sidebar, the content in the content part was loaded without reloading the page, but if the content part has a popup button, which somehow, it somehow stops working after being loaded by an Ajax, all the clicks and togles that are outside the content part work, but not inside, there are no errors in the inspector.

  • one
    api.jquery.com/on instead of $(<element selector>).click(function(){ ... }); use $(<parent selector>).on('click', <element selector>, function(event) { ... }); where <parent selector> defines the DOM element that lives the entire lifetime of the page and contains the elements defined by the <element selector> . - Igor
  • And the question is why? When the content of the “content part” is reloaded, all elements inside it are destroyed and re-created. New items do not have event handlers assigned before the reboot. - Igor

0