<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog - ShiftEleven &#187; recursion</title>
	<atom:link href="http://shifteleven.com/articles/tag/recursion/feed" rel="self" type="application/rss+xml" />
	<link>http://shifteleven.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 19 Sep 2009 11:19:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
		<item>
		<title>Engrish Javascript</title>
		<link>http://shifteleven.com/articles/2006/10/20/engrish-javascript</link>
		<comments>http://shifteleven.com/articles/2006/10/20/engrish-javascript#comments</comments>
		<pubDate>Sat, 21 Oct 2006 02:08:22 +0000</pubDate>
		<dc:creator>K. Adam Christensen</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[engrish]]></category>
		<category><![CDATA[Kim Jong Il]]></category>
		<category><![CDATA[racism]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[Team America]]></category>

		<guid isPermaLink="false">http://dev.fecalrod.com/articles/2006/10/20/engrish-javascript</guid>
		<description><![CDATA[In what I can think of as the most important JavaScript that I have ever written, I have made something which will parse the DOM(Document Object Model) and replace all of the &#8216;l&#8217;s with &#8216;r&#8217;s.  This idea came about after watching Team America: World Police about 1,000 times and after Kim Jong Il gave [...]]]></description>
			<content:encoded><![CDATA[<p>In what I can think of as the most important JavaScript that I have ever written, I have made something which will parse the DOM(Document Object Model) and replace all of the &#8216;l&#8217;s with &#8216;r&#8217;s.  This idea came about after watching <a href="http://www.rottentomatoes.com/m/team_america_world_police/">Team America: World Police</a> about 1,000 times and after <a href="http://en.wikipedia.org/wiki/Kim_Jong-il">Kim Jong Il</a> gave his <a href="http://www.theage.com.au/news/World/Kim-Jongil-sorry-about-nuclear-test/2006/10/20/1160851096275.html">apology</a> for doing some nuke testing. Back to the script:</p>
<pre class="javascript" title="code">function engrish(n) {
	if(n.nodeType == document.TEXT_NODE) {
		n.nodeValue = n.nodeValue.replace(/l/g, 'r').replace(/L/g, 'R');
	} else if(n.hasChildNodes()) {
		for(var i=0; i&lt;n.childNodes.length; i++) {
			engrish(n.childNodes[i]);
		}
	}
}</pre>
<p>To execute this code, simply call <code>engrish(document.documentElement);</code>.  Using <a href="http://www.htmlgoodies.com/primers/jsp/article.php/3622321,">recursion</a> this function goes through the DOM, finds text nodes and replaces the characters.</p>
<p><span id="more-16"></span></p>
<p>This is fine an dandy if you put this on your site so you can quickly convert your copy to <a href="http://www.engrish.com/detail.php?imagename=biohazard.jpg&amp;category=Signs/Posters&amp;date=2003-10-16;">engrish</a> however there is something that you can do to turn any page into it&#8217;s <a href="http://www.engrish.com/detail.php?imagename=dewdew.jpg&amp;category=Candy&amp;date=1996-10-18">engrish</a> form.  You can save this code as a <a href="http://mozilla.gunnars.net/firefox_bookmarks_tutorial.html.">bookmark</a></p>
<p>If you would like an example of what the bookmark URL would be, just <a href="javascript:function engrish(n) {if(n.nodeType == document.TEXT_NODE) {n.nodeValue = n.nodeValue.replace(/l/g, 'r').replace(/L/g, 'R');} else if(n.hasChildNodes()) {for(var i=0; i&lt;n.childNodes.length; i++) {engrish(n.childNodes[i]);}}} engrish(document.documentElement);">engrish-ify</a> this page and save the link as a bookmark (you can drag that link into your bookmark toolbar in <a href="http://www.mozilla.com/firefox/)">Firefox</a></p>
]]></content:encoded>
			<wfw:commentRss>http://shifteleven.com/articles/2006/10/20/engrish-javascript/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
