In another question, I asked why it takes so long to remove HTML content from a page with jQuery.
Apparently when removing HTML content from an element, jQuery has to march through each element and do... something.. I don't know exactly what. And this can take a vvery long time for large-ish HTML content.
In an effort to side-step the problem, I'm wondering:
Is there a way to add dynamic HTML content to a page, that uses jQuery, but NOT allow jquery to "adopt" the content?
In other words I want some subset of the HTML content in a page to be outside of the purview of active management by jQuery.
In this particular case, the content is within a jQuery accordion. So I want the accordion to work, but for everything beneath the divs for the accordion panels, I want jQuery to not be aware of those things. The goal is to short-circuit the very lengthy process it takes to remove that content, later.
Does this make sense?
possible?
What if, instead of doing something like $('#elementid').html(content)
, I just used the innerHTML property on the element itself, using document.getElementById()
Would that keep jQuery out of the subcontent?
I guess I'll try it, but if anyone has any insight, I'd appreciate it.