When having following code:
var morph = Metamorph('foo');
Which results in the following markup:
...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
...
When we call after() on the Metamorph instance:
We get this:
...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
bar
...
The innerHTML is not changed as it is injected after the script-tag.
And when we call prepend() on the Metamorph instance:
We get this:
...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
bar
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
...
However, the innerHTML is here not modified even though it changed the content between the script-tags, giving incorrect data when innerHTML is requested.
Should there also be a before() and append() function? (I don't mean appendTo() here.)
When having following code:
Which results in the following markup:
When we call
after()on the Metamorph instance:We get this:
The
innerHTMLis not changed as it is injected after the script-tag.And when we call
prepend()on the Metamorph instance:We get this:
However, the
innerHTMLis here not modified even though it changed the content between the script-tags, giving incorrect data wheninnerHTMLis requested.Should there also be a
before()andappend()function? (I don't meanappendTo()here.)