<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=2ni</id>
	<title>Microformats Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=2ni"/>
	<link rel="alternate" type="text/html" href="https://microformats.org/wiki/Special:Contributions/2ni"/>
	<updated>2026-05-15T11:16:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://microformats.org/wiki/index.php?title=rest/ahah&amp;diff=2983</id>
		<title>rest/ahah</title>
		<link rel="alternate" type="text/html" href="https://microformats.org/wiki/index.php?title=rest/ahah&amp;diff=2983"/>
		<updated>2005-11-27T22:18:54Z</updated>

		<summary type="html">&lt;p&gt;2ni: /* Executing Javascript */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= AHAH: Asychronous HTML and HTTP =&lt;br /&gt;
&lt;br /&gt;
AHAH is a very simple technique for dynamically updating web pages using [http://en.wikipedia.org/wiki/JavaScript JavaScript]. It involves using [http://en.wikipedia.org/wiki/XMLHTTP XMLHTTPRequest] to retrieve [http://en.wikipedia.org/wiki/HTML (X)HTML] fragments which are then inserted directly into the web page, whence they can be styled using [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS].&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [http://www.loudthinking.com/ David Hansson]&lt;br /&gt;
* [http://epeus.blogspot.com/ Kevin Marks]&lt;br /&gt;
* [http://www.opendarwin.org/~drernie/ Ernest Prabhakar]&lt;br /&gt;
&lt;br /&gt;
== Relation to AJAX ==&lt;br /&gt;
&lt;br /&gt;
AHAH is intended to be a much simpler way to do [http://en.wikipedia.org/wiki/Web_development web development] than [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX]: &amp;quot;Asynchronous JavaScript and XML.&amp;quot;  Strictly speaking, AHAH can be considered a subset of AJAX, since (X)HTML is just a special kind of XML.  However, it is a subset with some very specific and useful properties:&lt;br /&gt;
# The lack of custom XML schemas dramatically reduces design time&lt;br /&gt;
# AHAH can trivially reuse existing HTML pages, avoiding the need for a custom web service&lt;br /&gt;
# All data transport is done via browser-friend HTML, easing debugging and testing&lt;br /&gt;
# The HTML is designed to be directly embedded in the page's DOM, eliminating the need for parsing&lt;br /&gt;
# As HTML, designers can format it using CSS, rather than programmers having to do XSLT transforms&lt;br /&gt;
# Processing is all done on the server, so the client-side programming is essentiall nil (moving opaque bits)&lt;br /&gt;
&lt;br /&gt;
In fact, for any content that is destined to be viewed by the browser, it is virtually impossible to imagine any advantage to sending it as custom XML rather than structurally-correct HTML (with appropriate CSS-friendly class names, of course).&lt;br /&gt;
&lt;br /&gt;
That said, many applications of AJAX are (at least in theory) targeteable at custom JavaScript code or desktop GUIs rather than mere browsers.  For those cases, the advantages of HTML over custom XML are somewhat less.  However, even here, it may well make sense to encode data using [[xoxo]] -- aka XHTML Property Lists -- which can be losslessly converted back and forth from standard data structures (lists and dictionaries) without the need for custom parsers.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
Unlike the various libraries (e.g., [http://en.wikipedia.org/wiki/JSON JSON], [http://mochikit.com/ MochiKit]) important for AJAX, all of AHAH is contained in a single JavaScript file (also available as [http://www.opendarwin.org/~drernie/src/ahah.js ahah.js] and [http://homepage.mac.com/kevinmarks/jah.js jah.js]).  In fact, this is little more than the canonical XMLHttpRequest example, and is simple enough for any modern web designer to embed within their existing web pages.&lt;br /&gt;
&lt;br /&gt;
=== Send AHAH Request ===&lt;br /&gt;
&lt;br /&gt;
 function ahah(url,target) {&lt;br /&gt;
    // native XMLHttpRequest object&lt;br /&gt;
    document.getElementById(target).innerHTML = 'sending...';&lt;br /&gt;
    if (window.XMLHttpRequest) {&lt;br /&gt;
        req = new XMLHttpRequest();&lt;br /&gt;
        req.onreadystatechange = function() {ahahDone(target);};&lt;br /&gt;
        req.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;
        req.send(null);&lt;br /&gt;
    // IE/Windows ActiveX version&lt;br /&gt;
    } else if (window.ActiveXObject) {&lt;br /&gt;
        req = new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);&lt;br /&gt;
        if (req) {&lt;br /&gt;
            req.onreadystatechange = function() {ahahDone(target);};&lt;br /&gt;
            req.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;
            req.send();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }    &lt;br /&gt;
&lt;br /&gt;
Note the workaround needed for IE's ActiveX implementation.  The current version hard-codes GET; there may be value in adding an extra parameter to allow POST, PUT, and DELETE.&lt;br /&gt;
&lt;br /&gt;
=== Receive AHAH Request ===&lt;br /&gt;
&lt;br /&gt;
 function ahahDone(target) {&lt;br /&gt;
    // only if req is &amp;quot;loaded&amp;quot;&lt;br /&gt;
    if (req.readyState == 4) {&lt;br /&gt;
        // only if &amp;quot;OK&amp;quot;&lt;br /&gt;
        if (req.status == 200) {&lt;br /&gt;
            results = req.responseText;&lt;br /&gt;
            document.getElementById(target).innerHTML = results;&lt;br /&gt;
        } else {&lt;br /&gt;
            document.getElementById(target).innerHTML=&amp;quot;ahah error:\n&amp;quot; +&lt;br /&gt;
                req.statusText;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Other than error checking, the only real work done is:&lt;br /&gt;
&lt;br /&gt;
 document.getElementById(target).innerHTML = results;&lt;br /&gt;
&lt;br /&gt;
Everything else (e.g., CSS-styling) is merely inherited from the parent webpage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Executing Javascript ===&lt;br /&gt;
&lt;br /&gt;
Since the browser won't execute &amp;lt;script&amp;gt; tags when changing innerHTML, you may want to apply the following function call on document.getElementById(target):&lt;br /&gt;
&lt;br /&gt;
 var bSaf = (navigator.userAgent.indexOf('Safari') != -1);&lt;br /&gt;
 var bMoz = (navigator.appName == 'Netscape');&lt;br /&gt;
 function execJS(node) {&lt;br /&gt;
   var st = node.getElementsByTagName('script');&lt;br /&gt;
   var strExec;&lt;br /&gt;
   for(var i=0;i&amp;lt;st.length; i++) {     &lt;br /&gt;
     if (bSaf) {&lt;br /&gt;
       strExec = st[i].innerHTML;&lt;br /&gt;
     }&lt;br /&gt;
     else if (bMoz) {&lt;br /&gt;
       strExec = st[i].textContent;&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       strExec = st[i].text;&lt;br /&gt;
     }&lt;br /&gt;
     try {&lt;br /&gt;
       eval(strExec);&lt;br /&gt;
     } catch(e) {&lt;br /&gt;
       alert(e);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;AHAH&amp;quot; as a formal technique appears to have been introduced by Kevin Marks on May 12, 2005 under the name [http://epeus.blogspot.com/2005_05_01_epeus_archive.html#111588374981985824 JAH]: &amp;quot;Just Asynchronous HTML&amp;quot;, where it was also used in a [http://homepage.mac.com/kevinmarks/staticjah.html simple example].  The term &amp;quot;AHAH&amp;quot; was proposed by Ernest Prabhakar during the 2005 [http://www.web2con.com/ Web 2.0] conference, and later adopted as part of the REST-Enabled XHTML ([http://www.opendarwin.org/~drernie/C395201355/E20051019175947/index.html REX]) microformat for web services.&lt;br /&gt;
&lt;br /&gt;
David Hansson had independently discovered the exact same concept, and in fact had already submitted an abstract about it for O'Reilly's 2006 [http://conferences.oreillynet.com/etech/ E-Tech] conference when he encountered the work done by Marks and Prabhakar.  He had not however named the technique, and quickly agreed to adopt the AHAH moniker.  The same concept has no doubt been independently discovered by others, but these three appear to be the first to make a sustained attempt to promote it as a formal technique.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
* Sample [http://www.opendarwin.org/~drernie/src/ahah.js JavaScript code] available from Ernie Prabhakar, extending work by Kevin Marks.&lt;br /&gt;
* There is some talk of directly supporting AHAH in [http://www.rubyonrails.com/ Ruby on Rails] using [http://wiki.rubyonrails.com/rails/pages/UnderstandingPartials partials].&lt;/div&gt;</summary>
		<author><name>2ni</name></author>
	</entry>
	<entry>
		<id>https://microformats.org/wiki/index.php?title=rest/ahah&amp;diff=2975</id>
		<title>rest/ahah</title>
		<link rel="alternate" type="text/html" href="https://microformats.org/wiki/index.php?title=rest/ahah&amp;diff=2975"/>
		<updated>2005-11-27T04:03:32Z</updated>

		<summary type="html">&lt;p&gt;2ni: /* Executing Javascript */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= AHAH: Asychronous HTML and HTTP =&lt;br /&gt;
&lt;br /&gt;
AHAH is a very simple technique for dynamically updating web pages using [http://en.wikipedia.org/wiki/JavaScript JavaScript]. It involves using [http://en.wikipedia.org/wiki/XMLHTTP XMLHTTPRequest] to retrieve [http://en.wikipedia.org/wiki/HTML (X)HTML] fragments which are then inserted directly into the web page, whence they can be styled using [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS].&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [http://www.loudthinking.com/ David Hansson]&lt;br /&gt;
* [http://epeus.blogspot.com/ Kevin Marks]&lt;br /&gt;
* [http://www.opendarwin.org/~drernie/ Ernest Prabhakar]&lt;br /&gt;
&lt;br /&gt;
== Relation to AJAX ==&lt;br /&gt;
&lt;br /&gt;
AHAH is intended to be a much simpler way to do [http://en.wikipedia.org/wiki/Web_development web development] than [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX]: &amp;quot;Asynchronous JavaScript and XML.&amp;quot;  Strictly speaking, AHAH can be considered a subset of AJAX, since (X)HTML is just a special kind of XML.  However, it is a subset with some very specific and useful properties:&lt;br /&gt;
# The lack of custom XML schemas dramatically reduces design time&lt;br /&gt;
# AHAH can trivially reuse existing HTML pages, avoiding the need for a custom web service&lt;br /&gt;
# All data transport is done via browser-friend HTML, easing debugging and testing&lt;br /&gt;
# The HTML is designed to be directly embedded in the page's DOM, eliminating the need for parsing&lt;br /&gt;
# As HTML, designers can format it using CSS, rather than programmers having to do XSLT transforms&lt;br /&gt;
# Processing is all done on the server, so the client-side programming is essentiall nil (moving opaque bits)&lt;br /&gt;
&lt;br /&gt;
In fact, for any content that is destined to be viewed by the browser, it is virtually impossible to imagine any advantage to sending it as custom XML rather than structurally-correct HTML (with appropriate CSS-friendly class names, of course).&lt;br /&gt;
&lt;br /&gt;
That said, many applications of AJAX are (at least in theory) targeteable at custom JavaScript code or desktop GUIs rather than mere browsers.  For those cases, the advantages of HTML over custom XML are somewhat less.  However, even here, it may well make sense to encode data using [[xoxo]] -- aka XHTML Property Lists -- which can be losslessly converted back and forth from standard data structures (lists and dictionaries) without the need for custom parsers.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
Unlike the various libraries (e.g., [http://en.wikipedia.org/wiki/JSON JSON], [http://mochikit.com/ MochiKit]) important for AJAX, all of AHAH is contained in a single JavaScript file (also available as [http://www.opendarwin.org/~drernie/src/ahah.js ahah.js] and [http://homepage.mac.com/kevinmarks/jah.js jah.js]).  In fact, this is little more than the canonical XMLHttpRequest example, and is simple enough for any modern web designer to embed within their existing web pages.&lt;br /&gt;
&lt;br /&gt;
=== Send AHAH Request ===&lt;br /&gt;
&lt;br /&gt;
 function ahah(url,target) {&lt;br /&gt;
    // native XMLHttpRequest object&lt;br /&gt;
    document.getElementById(target).innerHTML = 'sending...';&lt;br /&gt;
    if (window.XMLHttpRequest) {&lt;br /&gt;
        req = new XMLHttpRequest();&lt;br /&gt;
        req.onreadystatechange = function() {ahahDone(target);};&lt;br /&gt;
        req.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;
        req.send(null);&lt;br /&gt;
    // IE/Windows ActiveX version&lt;br /&gt;
    } else if (window.ActiveXObject) {&lt;br /&gt;
        req = new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);&lt;br /&gt;
        if (req) {&lt;br /&gt;
            req.onreadystatechange = function() {ahahDone(target);};&lt;br /&gt;
            req.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;
            req.send();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }    &lt;br /&gt;
&lt;br /&gt;
Note the workaround needed for IE's ActiveX implementation.  The current version hard-codes GET; there may be value in adding an extra parameter to allow POST, PUT, and DELETE.&lt;br /&gt;
&lt;br /&gt;
=== Receive AHAH Request ===&lt;br /&gt;
&lt;br /&gt;
 function ahahDone(target) {&lt;br /&gt;
    // only if req is &amp;quot;loaded&amp;quot;&lt;br /&gt;
    if (req.readyState == 4) {&lt;br /&gt;
        // only if &amp;quot;OK&amp;quot;&lt;br /&gt;
        if (req.status == 200) {&lt;br /&gt;
            results = req.responseText;&lt;br /&gt;
            document.getElementById(target).innerHTML = results;&lt;br /&gt;
        } else {&lt;br /&gt;
            document.getElementById(target).innerHTML=&amp;quot;ahah error:\n&amp;quot; +&lt;br /&gt;
                req.statusText;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Other than error checking, the only real work done is:&lt;br /&gt;
&lt;br /&gt;
 document.getElementById(target).innerHTML = results;&lt;br /&gt;
&lt;br /&gt;
Everything else (e.g., CSS-styling) is merely inherited from the parent webpage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Executing Javascript ===&lt;br /&gt;
&lt;br /&gt;
Since the browser won't execute &amp;lt;script&amp;gt; tags when changing innerHTML, you may want to apply the following function call on document.getElementById(target):&lt;br /&gt;
&lt;br /&gt;
 var bSaf = (navigator.userAgent.indexOf('Safari') != -1);&lt;br /&gt;
 var bMoz = (navigator.appName == 'Netscape');&lt;br /&gt;
 function execJS(node) {&lt;br /&gt;
   var st = node.getElementsByTagName('script');&lt;br /&gt;
   for(var i=0;i&amp;lt;st.length; i++) {&lt;br /&gt;
     if (bSaf) {&lt;br /&gt;
       eval(st[i].innerHTML);&lt;br /&gt;
     }&lt;br /&gt;
     else if (bMoz) {&lt;br /&gt;
       eval(st[i].textContent);&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       eval(st[i].text);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;AHAH&amp;quot; as a formal technique appears to have been introduced by Kevin Marks on May 12, 2005 under the name [http://epeus.blogspot.com/2005_05_01_epeus_archive.html#111588374981985824 JAH]: &amp;quot;Just Asynchronous HTML&amp;quot;, where it was also used in a [http://homepage.mac.com/kevinmarks/staticjah.html simple example].  The term &amp;quot;AHAH&amp;quot; was proposed by Ernest Prabhakar during the 2005 [http://www.web2con.com/ Web 2.0] conference, and later adopted as part of the REST-Enabled XHTML ([http://www.opendarwin.org/~drernie/C395201355/E20051019175947/index.html REX]) microformat for web services.&lt;br /&gt;
&lt;br /&gt;
David Hansson had independently discovered the exact same concept, and in fact had already submitted an abstract about it for O'Reilly's 2006 [http://conferences.oreillynet.com/etech/ E-Tech] conference when he encountered the work done by Marks and Prabhakar.  He had not however named the technique, and quickly agreed to adopt the AHAH moniker.  The same concept has no doubt been independently discovered by others, but these three appear to be the first to make a sustained attempt to promote it as a formal technique.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
* Sample [http://www.opendarwin.org/~drernie/src/ahah.js JavaScript code] available from Ernie Prabhakar, extending work by Kevin Marks.&lt;br /&gt;
* There is some talk of directly supporting AHAH in [http://www.rubyonrails.com/ Ruby on Rails] using [http://wiki.rubyonrails.com/rails/pages/UnderstandingPartials partials].&lt;/div&gt;</summary>
		<author><name>2ni</name></author>
	</entry>
	<entry>
		<id>https://microformats.org/wiki/index.php?title=rest/ahah&amp;diff=2974</id>
		<title>rest/ahah</title>
		<link rel="alternate" type="text/html" href="https://microformats.org/wiki/index.php?title=rest/ahah&amp;diff=2974"/>
		<updated>2005-11-27T01:24:13Z</updated>

		<summary type="html">&lt;p&gt;2ni: /* Receive AHAH Request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= AHAH: Asychronous HTML and HTTP =&lt;br /&gt;
&lt;br /&gt;
AHAH is a very simple technique for dynamically updating web pages using [http://en.wikipedia.org/wiki/JavaScript JavaScript]. It involves using [http://en.wikipedia.org/wiki/XMLHTTP XMLHTTPRequest] to retrieve [http://en.wikipedia.org/wiki/HTML (X)HTML] fragments which are then inserted directly into the web page, whence they can be styled using [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS].&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [http://www.loudthinking.com/ David Hansson]&lt;br /&gt;
* [http://epeus.blogspot.com/ Kevin Marks]&lt;br /&gt;
* [http://www.opendarwin.org/~drernie/ Ernest Prabhakar]&lt;br /&gt;
&lt;br /&gt;
== Relation to AJAX ==&lt;br /&gt;
&lt;br /&gt;
AHAH is intended to be a much simpler way to do [http://en.wikipedia.org/wiki/Web_development web development] than [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX]: &amp;quot;Asynchronous JavaScript and XML.&amp;quot;  Strictly speaking, AHAH can be considered a subset of AJAX, since (X)HTML is just a special kind of XML.  However, it is a subset with some very specific and useful properties:&lt;br /&gt;
# The lack of custom XML schemas dramatically reduces design time&lt;br /&gt;
# AHAH can trivially reuse existing HTML pages, avoiding the need for a custom web service&lt;br /&gt;
# All data transport is done via browser-friend HTML, easing debugging and testing&lt;br /&gt;
# The HTML is designed to be directly embedded in the page's DOM, eliminating the need for parsing&lt;br /&gt;
# As HTML, designers can format it using CSS, rather than programmers having to do XSLT transforms&lt;br /&gt;
# Processing is all done on the server, so the client-side programming is essentiall nil (moving opaque bits)&lt;br /&gt;
&lt;br /&gt;
In fact, for any content that is destined to be viewed by the browser, it is virtually impossible to imagine any advantage to sending it as custom XML rather than structurally-correct HTML (with appropriate CSS-friendly class names, of course).&lt;br /&gt;
&lt;br /&gt;
That said, many applications of AJAX are (at least in theory) targeteable at custom JavaScript code or desktop GUIs rather than mere browsers.  For those cases, the advantages of HTML over custom XML are somewhat less.  However, even here, it may well make sense to encode data using [[xoxo]] -- aka XHTML Property Lists -- which can be losslessly converted back and forth from standard data structures (lists and dictionaries) without the need for custom parsers.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
Unlike the various libraries (e.g., [http://en.wikipedia.org/wiki/JSON JSON], [http://mochikit.com/ MochiKit]) important for AJAX, all of AHAH is contained in a single JavaScript file (also available as [http://www.opendarwin.org/~drernie/src/ahah.js ahah.js] and [http://homepage.mac.com/kevinmarks/jah.js jah.js]).  In fact, this is little more than the canonical XMLHttpRequest example, and is simple enough for any modern web designer to embed within their existing web pages.&lt;br /&gt;
&lt;br /&gt;
=== Send AHAH Request ===&lt;br /&gt;
&lt;br /&gt;
 function ahah(url,target) {&lt;br /&gt;
    // native XMLHttpRequest object&lt;br /&gt;
    document.getElementById(target).innerHTML = 'sending...';&lt;br /&gt;
    if (window.XMLHttpRequest) {&lt;br /&gt;
        req = new XMLHttpRequest();&lt;br /&gt;
        req.onreadystatechange = function() {ahahDone(target);};&lt;br /&gt;
        req.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;
        req.send(null);&lt;br /&gt;
    // IE/Windows ActiveX version&lt;br /&gt;
    } else if (window.ActiveXObject) {&lt;br /&gt;
        req = new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);&lt;br /&gt;
        if (req) {&lt;br /&gt;
            req.onreadystatechange = function() {ahahDone(target);};&lt;br /&gt;
            req.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;
            req.send();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }    &lt;br /&gt;
&lt;br /&gt;
Note the workaround needed for IE's ActiveX implementation.  The current version hard-codes GET; there may be value in adding an extra parameter to allow POST, PUT, and DELETE.&lt;br /&gt;
&lt;br /&gt;
=== Receive AHAH Request ===&lt;br /&gt;
&lt;br /&gt;
 function ahahDone(target) {&lt;br /&gt;
    // only if req is &amp;quot;loaded&amp;quot;&lt;br /&gt;
    if (req.readyState == 4) {&lt;br /&gt;
        // only if &amp;quot;OK&amp;quot;&lt;br /&gt;
        if (req.status == 200) {&lt;br /&gt;
            results = req.responseText;&lt;br /&gt;
            document.getElementById(target).innerHTML = results;&lt;br /&gt;
        } else {&lt;br /&gt;
            document.getElementById(target).innerHTML=&amp;quot;ahah error:\n&amp;quot; +&lt;br /&gt;
                req.statusText;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Other than error checking, the only real work done is:&lt;br /&gt;
&lt;br /&gt;
 document.getElementById(target).innerHTML = results;&lt;br /&gt;
&lt;br /&gt;
Everything else (e.g., CSS-styling) is merely inherited from the parent webpage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Executing Javascript ===&lt;br /&gt;
&lt;br /&gt;
Since the browser won't execute &amp;lt;script&amp;gt; when changing innerHTML, you may want to apply the following function call on document.getElementById(target):&lt;br /&gt;
&lt;br /&gt;
 var bSaf = (navigator.userAgent.indexOf('Safari') != -1);&lt;br /&gt;
 var bMoz = (navigator.appName == 'Netscape');&lt;br /&gt;
 function execJS(node) {&lt;br /&gt;
   var st = node.getElementsByTagName('script');&lt;br /&gt;
   for(var i=0;i&amp;lt;st.length; i++) {&lt;br /&gt;
     if (bSaf) {&lt;br /&gt;
       eval(st[i].innerHTML);&lt;br /&gt;
     }&lt;br /&gt;
     else if (bMoz) {&lt;br /&gt;
       eval(st[i].textContent);&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       eval(st[i].text);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;AHAH&amp;quot; as a formal technique appears to have been introduced by Kevin Marks on May 12, 2005 under the name [http://epeus.blogspot.com/2005_05_01_epeus_archive.html#111588374981985824 JAH]: &amp;quot;Just Asynchronous HTML&amp;quot;, where it was also used in a [http://homepage.mac.com/kevinmarks/staticjah.html simple example].  The term &amp;quot;AHAH&amp;quot; was proposed by Ernest Prabhakar during the 2005 [http://www.web2con.com/ Web 2.0] conference, and later adopted as part of the REST-Enabled XHTML ([http://www.opendarwin.org/~drernie/C395201355/E20051019175947/index.html REX]) microformat for web services.&lt;br /&gt;
&lt;br /&gt;
David Hansson had independently discovered the exact same concept, and in fact had already submitted an abstract about it for O'Reilly's 2006 [http://conferences.oreillynet.com/etech/ E-Tech] conference when he encountered the work done by Marks and Prabhakar.  He had not however named the technique, and quickly agreed to adopt the AHAH moniker.  The same concept has no doubt been independently discovered by others, but these three appear to be the first to make a sustained attempt to promote it as a formal technique.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
* Sample [http://www.opendarwin.org/~drernie/src/ahah.js JavaScript code] available from Ernie Prabhakar, extending work by Kevin Marks.&lt;br /&gt;
* There is some talk of directly supporting AHAH in [http://www.rubyonrails.com/ Ruby on Rails] using [http://wiki.rubyonrails.com/rails/pages/UnderstandingPartials partials].&lt;/div&gt;</summary>
		<author><name>2ni</name></author>
	</entry>
</feed>