Recently, I started using the new JS&SVG implementation of font-awesome's v5 icons. It seems to be working perfectly for icons (such as
<i class='fas fa-home'></i>
) that are already present in the DOM at page load. The <i>
tag successfully gets replaced with an <svg>
tag.
However, a problem arises when I dynamically load HTML content from the server and insert it into the DOM. In this scenario, the <i>
tags do not get converted, resulting in no icons being displayed. I have been unable to find any method in my JavaScript code that can force the JS implementation to reload the SVG icons after the new content is added to the DOM.
Has anyone else encountered this issue before?