<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Prototype JavaScript framework - Insertion</title>
  <id>tag:www.prototypejs.org,2008:mephisto/api/insertion</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://www.prototypejs.org/feed/api/insertion/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.prototypejs.org/api/insertion" rel="alternate" type="text/html"/>
  <updated>2007-11-06T13:12:17Z</updated>
  <entry xml:base="http://www.prototypejs.org/">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:www.prototypejs.org,2007-01-15:13066</id>
    <published>2007-01-15T22:29:00Z</published>
    <updated>2007-11-06T13:12:17Z</updated>
    <category term="Insertion"/>
    <category term="deprecated"/>
    <link href="http://www.prototypejs.org/api/insertion" rel="alternate" type="text/html"/>
    <title>Insertion</title>
<content type="html">
            &lt;p class=&quot;deprecated&quot;&gt;As of Prototype 1.6, the complete &lt;code&gt;Insertion&lt;/code&gt; class has been deprecated in favor of &lt;a href=&quot;/api/element/insert&quot;&gt;&lt;code&gt;Element#insert&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insertion&lt;/code&gt; provides a cross-browser solution to the dynamic insertion of HTML snippets (or plain text, obviously). Comes in four flavors: &lt;code&gt;After&lt;/code&gt;,  &lt;code&gt;Before&lt;/code&gt;, &lt;code&gt;Bottom&lt;/code&gt; and &lt;code&gt;Top&lt;/code&gt;, which behave just as expected.&lt;/p&gt;

&lt;p&gt;Note that if the inserted HTML contains any &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, these will be automatically evaluated after the insertion (&lt;code&gt;Insertion&lt;/code&gt; internally calls &lt;a href=&quot;/api/string/evalScripts&quot;&gt;String#evalScripts&lt;/a&gt;). &lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.prototypejs.org/">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:www.prototypejs.org,2007-01-08:13000</id>
    <published>2007-01-08T03:58:00Z</published>
    <updated>2007-11-06T12:33:48Z</updated>
    <category term="Insertion"/>
    <category term="deprecated"/>
    <link href="http://www.prototypejs.org/api/insertion/after" rel="alternate" type="text/html"/>
    <title>After</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.After(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the next sibling of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.After(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the next sibling of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;
&lt;p class=&quot;deprecated&quot;&gt;As of Prototype 1.6, the complete &lt;code&gt;Insertion&lt;/code&gt; class has been deprecated in favor of &lt;a href=&quot;/api/element/insert&quot;&gt;&lt;code&gt;Element#insert&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note that if the inserted HTML contains any &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, these will be automatically evaluated after the insertion (&lt;code&gt;Insertion.After&lt;/code&gt; internally calls &lt;a href=&quot;/api/string/evalScripts&quot;&gt;String#evalScripts&lt;/a&gt;). &lt;/p&gt;

&lt;h3&gt;Example&lt;/h3&gt;

&lt;h4&gt;Original HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div&amp;gt;
    &amp;lt;p id=&quot;animal_vegetable_mineral&quot;&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;JavaScript&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
  new Insertion.After('animal_vegetable_mineral', &quot;&amp;lt;p&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Resulting HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div&amp;gt;
    &amp;lt;p id=&quot;animal_vegetable_mineral&quot;&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://www.prototypejs.org/">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:www.prototypejs.org,2007-01-08:13001</id>
    <published>2007-01-08T03:58:00Z</published>
    <updated>2007-11-06T12:33:44Z</updated>
    <category term="Insertion"/>
    <category term="deprecated"/>
    <link href="http://www.prototypejs.org/api/insertion/before" rel="alternate" type="text/html"/>
    <title>Before</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.Before(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the previous sibling of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.Before(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the previous sibling of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;
&lt;p class=&quot;deprecated&quot;&gt;As of Prototype 1.6, the complete &lt;code&gt;Insertion&lt;/code&gt; class has been deprecated in favor of &lt;a href=&quot;/api/element/insert&quot;&gt;&lt;code&gt;Element#insert&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note that if the inserted HTML contains any &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, these will be automatically evaluated after the insertion (&lt;code&gt;Insertion.Before&lt;/code&gt; internally calls &lt;a href=&quot;/api/string/evalScripts&quot;&gt;String#evalScripts&lt;/a&gt;). &lt;/p&gt;

&lt;h3&gt;Example&lt;/h3&gt;

&lt;h4&gt;Original HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div&amp;gt;
    &amp;lt;p id=&quot;modern_major_general&quot;&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;JavaScript&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
  new Insertion.Before('modern_major_general', &quot;&amp;lt;p&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Resulting HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div&amp;gt;
    &amp;lt;p&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;
    &amp;lt;p id=&quot;modern_major_general&quot;&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://www.prototypejs.org/">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:www.prototypejs.org,2007-01-08:12999</id>
    <published>2007-01-08T03:57:00Z</published>
    <updated>2007-11-06T12:33:42Z</updated>
    <category term="Insertion"/>
    <category term="deprecated"/>
    <link href="http://www.prototypejs.org/api/insertion/bottom" rel="alternate" type="text/html"/>
    <title>Bottom</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.Bottom(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the last child of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.Bottom(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the last child of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;
&lt;p class=&quot;deprecated&quot;&gt;As of Prototype 1.6, the complete &lt;code&gt;Insertion&lt;/code&gt; class has been deprecated in favor of &lt;a href=&quot;/api/element/insert&quot;&gt;&lt;code&gt;Element#insert&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note that if the inserted HTML contains any &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, these will be automatically evaluated after the insertion (&lt;code&gt;Insertion.Bottom&lt;/code&gt; internally calls &lt;a href=&quot;/api/string/evalScripts&quot;&gt;String#evalScripts&lt;/a&gt;). &lt;/p&gt;

&lt;h3&gt;Example&lt;/h3&gt;

&lt;h4&gt;Original HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div id=&amp;quot;modern_major_general&amp;quot;&amp;gt;
    &amp;lt;p&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;JavaScript&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
  new Insertion.Bottom('modern_major_general', &quot;&amp;lt;p&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Resulting HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div id=&amp;quot;modern_major_general&amp;quot;&amp;gt;
    &amp;lt;p&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://www.prototypejs.org/">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:www.prototypejs.org,2007-01-08:12998</id>
    <published>2007-01-08T03:55:00Z</published>
    <updated>2007-11-06T12:33:37Z</updated>
    <category term="Insertion"/>
    <category term="deprecated"/>
    <link href="http://www.prototypejs.org/api/insertion/top" rel="alternate" type="text/html"/>
    <title>Top</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.Top(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the first child of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;new Insertion.Top(element, html)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts the &lt;code&gt;html&lt;/code&gt; into the page as the first child of &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;
&lt;p class=&quot;deprecated&quot;&gt;As of Prototype 1.6, the complete &lt;code&gt;Insertion&lt;/code&gt; class has been deprecated in favor of &lt;a href=&quot;/api/element/insert&quot;&gt;&lt;code&gt;Element#insert&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note that if the inserted HTML contains any &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, these will be automatically evaluated after the insertion (&lt;code&gt;Insertion.Top&lt;/code&gt; internally calls &lt;a href=&quot;/api/string/evalScripts&quot;&gt;String#evalScripts&lt;/a&gt;). &lt;/p&gt;

&lt;h3&gt;Example&lt;/h3&gt;

&lt;h4&gt;Original HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div id=&amp;quot;modern_major_general&amp;quot;&amp;gt;
    &amp;lt;p&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;JavaScript&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
  new Insertion.Top('modern_major_general', &quot;&amp;lt;p&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Resulting HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;div id=&amp;quot;modern_major_general&amp;quot;&amp;gt;
    &amp;lt;p&amp;gt;In short, in all things vegetable, animal, and mineral...&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;I am the very model of a modern major general.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
</feed>
