For over 10 years now we have developed single page applications where an AJAX call goes out and downloads the text/html of an inner page from a template folder with all of our page content. When it downloads it the div inside index.htm where the content is put is cleared with $('#' + container).contents().remove();
then we insert the new html with $('#' + container).html(content);
.
We have been using version 3.3.1 for almost 5 years now and decided to update to a newer version. The recent ones sound like they internally use Plain Vanilla JavaScript to manipulate instead of the old engine in jQuery. It seems to get easily confused though and will scramble the inserted HTML or parts will be outright missing like they were never there. It seems to have the most problems with self-closing tags and tags in a section that repeat like 2-3+ spans or inputs in a row, and it will try to nest them when they weren't nested, set the html after as if it were inside the tag or the value of the input, some will be out of order, or 2+ of them will just not be there.
I tried 3 versions after 3.3.1 and they all output wrong. When I go back to 3.3.1 everything is fine again.