Insertion

Insertion提供了跨浏览器的html动态插入方法,这里的html可以包括javascript.因为Insertion内部已经调用了String.evalScript()

after()/before():new Insertion.After(element,html)

<div>
    <p id="animal_vegetable_mineral">In short,in all things vegetable,animal,andmineral...</p>
</div>

var insertion = new Insertion.After('animal_vegetable_mineral',"<p>I am the very model of a modern major general.</p>");

<div>
    <p id="animal_vegetable_mineral">In short,in all things vegetable,animal,and mineral...</p>
<p>I am the very model of a modern major general.</p>
</div>

top()/bottom():newInsertion.Top(element,html)

<div id="modern_major_general">
<p>I am the very model of a modern major general.</p>
</div>

new Insertion.Top('modern_major_general',"<p>In short,in all things vegetable,animal,andmineral...</p>");

<divid="modern_major_general">
<p>In short,in all things vegetable,animal,andmineral...</p>
<p>I am the very model of a modern major general.</p>
</div>