Top
不推荐

new Insertion.Top(element, html)

html 插入到页面中作为 element 的最前面的子节点。

从 Prototype 1.6 开始,Insertion 类已经完全被 Element#insert 取代。

注意,如果插入的 HTML 包含有 <script> 标签,在插入后标签中的脚本会被自动执行 (Insertion.Top 在内部调用 String#evalScripts)。

样例

初始的 HTML

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

JavaScript

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

最终的 HTML

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