HTML Imports: Remove Import

384 Views Asked by At

I work on a WebApp, that dynamically loads *.html files via XHR, takes the files <body> as a string adds it to the document with insertAdjacentHTML. It does the same with the files JavaScript and evals the scirpt tags content. (There are comments in the file denoting start end end of the relevant sections.)

I'm evaluating the possibility to switch to HTML Imports. I hope for it to be faster since it uses native functions, and does all the parsing etc.

Since I am loading and unloading hundrets of files over time, I need to be sure the files I import are completely removed from the DOM once I don't need them anymore. (Because of possible Memory-Leaks).

Is removing the <link> Tag (and the appended content) sufficient or is there more I need to do?

0

There are 0 best solutions below