Closed ghost closed 9 years ago
The code will still work if you jump in there and set a check on it and break the loop if no child nodes. Stop the while loop from running.
Attachement allows to "load" a template which has been generated server side. So to make it works the virtual tree, you called toHtml()
on server side, must be the one you are using with attach()
client side. So if you are calling attach()
on a virtual tree, the mount point must contain the html you get by calling toHtml()
on it. Attaching some random html to a virtual tree doesn't work and is not supposed to. If you can't rely on the html generated server side you must clear up your mount point and use mount()
.
If you want to have something to read, check your code again: https://jsfiddle.net/buf3wa3d/
Then in the HTML markup, remove
Click me!
so it become:<div id="mount-point"><div></div></div>
Now look into the console:
TypeError: childNodes[j] is undefined
You can also remove the whole html markup, and the same error are visible.
Not sure if this a error message that is logic for end-devs, but it's located here
dom-layer.min.js (line 1, col 19433)
Yes, I know it's stupid to remove the HTML markup, but at least this trigger something.