<?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>Povert &#187; WWW</title>
	<atom:link href="http://www.povert.com/category/technology/world-wide-web-related-code-discussion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.povert.com</link>
	<description>It&#039;s Pronounced &#34;Pah-vert.&#34;  You povert.</description>
	<lastBuildDate>Sun, 25 Jul 2010 03:38:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>New Flapping Crane Site</title>
		<link>http://www.povert.com/2010/02/11/new-flapping-crane-site/</link>
		<comments>http://www.povert.com/2010/02/11/new-flapping-crane-site/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 01:54:48 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Flapping Crane]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[Modernizr]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=961</guid>
		<description><![CDATA[The new version of Flapping Crane is up, along with a strange video to commemorate it. You&#8217;ll notice that Pete mentions a new web site and says &#8220;2008&#8243;. Yup, been working on it for that long. Longer, even. The site had stayed unchanged design-wise since at least December 2005. I was kicking ideas around for [...]]]></description>
			<content:encoded><![CDATA[<p>The new version of <a href="http://flappingcrane.com/">Flapping Crane</a> is up, along with a strange video to commemorate it.</p>
<p>You&#8217;ll notice that Pete mentions a new web site and says &#8220;2008&#8243;.  Yup, been working on it for that long.  Longer, even.</p>
<p>The site had stayed unchanged design-wise since at least December 2005.  I was kicking ideas around for a new version at least since 2006.</p>
<p>In early 2008, I had a conversation with Shawn, who came up with this mock:</p>
<p><img src="http://www.povert.com/wp-content/uploads/2010/02/FC-2008-website-c2.jpg" alt="FC-2008-website-c2.jpg" border="0" width="385" height="500" /></p>
<p>It&#8217;s had a lot of changes since then (Alex had some ideas for simplifying the interface), but that&#8217;s basically the same as what is live now.</p>
<p>Part of what took so long was that early on I tried to do way too much.  I later decided to drop &#8220;buy&#8221; and &#8220;pics&#8221;.  They may come back later; I haven&#8217;t decided.  We also drop a lot of the video categories.  There were just way too many.</p>
<p>I&#8217;ve changed the way that &#8220;Most Popular&#8221; is determined — the top six skits were listed as the most popular for about 3 years.  So now it displays the most popular from the last 2 weeks.  It&#8217;s kind of interesting that way.  It changes up a lot.</p>
<p>Anyway, for anyone interested in the nitty-gritty, the site uses <a href="http://developer.yahoo.com/yui/">YUI</a> 2.6.0.  I considered updating it for 2.8.0 or even 3.0, but I&#8217;d already Duke Nukem&#8217; Forever&#8217;d this thing long enough.  It also makes minor use of <a href="http://www.modernizr.com/">Modernizr</a>, mostly to detect whether the browser supports h264.  Eventually the site will support ogg theora too.  That&#8217;s a lot of skits to convert.  At the moment, Safari and Chrome will display the videos natively, while all other browsers will use flash (<a href="http://www.longtailvideo.com/players/jw-flv-player/">JW Player</a>).</p>
<p>I&#8217;ve only done minimal fixes for Internet Explorer.  It works in IE 6-8, though it doesn&#8217;t look as pretty.  I&#8217;ll mop that up later.  Maybe.  See the FAQ on the new site for my attitude towards IE in general (IE 6 in particular).</p>
<p>Also note that the videos are much larger, screen-wise.  They are 640&#215;360 for wide and 640&#215;480 for standard.  I re-encoded almost every single Flapping Crane video, not counting outtakes, which aren&#8217;t on the new site anyway (at least not yet).</p>
<p>Finally, if you were bored enough to make it this long: Yes, there will be new skits.  I bought a house, got married, got a dog, etc.  Haven&#8217;t had a lot of time to edit videos <em>and</em> get this new site up, so it may be a while before any truly new skits show up.  There are, however, some skits that haven&#8217;t been put up yet that I may sneak in *COUGH*toofies*COUGH*.</p>
<p>And yes, there will be actual new, recently shot skits up soon.  Well, eventually.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2010/02/11/new-flapping-crane-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s Wrong With Ads</title>
		<link>http://www.povert.com/2010/01/08/whats-wrong-with-ads/</link>
		<comments>http://www.povert.com/2010/01/08/whats-wrong-with-ads/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 19:26:38 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[ads]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=914</guid>
		<description><![CDATA[Ads drive me nuts. Not for the reasons it drive some people nuts — as long as they&#8217;re not intrusive, I don&#8217;t mind. I don&#8217;t regularly use AdBlock, though I do use ClickToFlash in Safari for various reasons. I don&#8217;t even think that Flash ads, per se, are a problem. I see two basic problems: [...]]]></description>
			<content:encoded><![CDATA[<p>Ads drive me nuts.</p>
<p>Not for the reasons it drive some people nuts — as long as they&#8217;re not intrusive, I don&#8217;t mind.  I don&#8217;t regularly use AdBlock, though I do use ClickToFlash in Safari for various reasons.  I don&#8217;t even think that Flash ads, per se, are a problem.</p>
<p>I see two basic problems:</p>
<ol>
<li>document.write()</li>
<li>Invalid markup</li>
</ol>
<h3>document.write()</h3>
<p>I hate document.write().  I&#8217;m pretty sure that I am <strong>That Guy At Work Who Hates document.write() With Unreasonable And Embarrassing Passion™</strong>, but it really does limit your options and it contributes to poor page load and rendering times.</p>
<p>Amazingly, a quick search of my past entries here turned up very little about my disdain for document.write(), so I&#8217;ll briefly summarize the problem.</p>
<p>Web browsers don&#8217;t handle external scripts very well.  Because of things like document.write(), the browser actually has to pause the rendering of the page.  Unfortunately, if the script is long-running or the server it&#8217;s on is slow or non-responsive, this can significantly increase the apparent page load time.  Several mildly misbehaving external scripts on a page can have a dramatic cumulative effect.  I set up an <a href="http://sandwichestime.com/loop/">example</a> of this while back to demonstrate this.</p>
<p>This is how most ads are delivered to a page.  So a single ad placed anywhere before any important content on a page can block the display of that page until the ad is displayed.</p>
<p>There are ways around this.  One way would be to have a external javascript file called early in the page.  Then ad positions on the page wouldn&#8217;t be additional external script tags — they would be calls to a function or functions in that main javascript file (I believe Google Adsense allows for something like this method, at least in some circumstances).  You could even get away with document.write() in this case, though that wouldn&#8217;t be eliminating problem #2.  More on that in a moment.  But there is still a basic problem here — we&#8217;re down to one external script, but if its host server is unresponsive, the display of all or most of the page will be held up until it resolves or times out.</p>
<p>Another way would be to dynamically create script tags and append them to the document&#8217;s head.  These tags would point to the external scripts.  But because they&#8217;re inserted this way, the browser doesn&#8217;t have to hold up the page rendering.  YUI&#8217;s <a href="http://developer.yahoo.com/yui/get/#script">Get.script()</a> does exactly this with some handy features thrown in as well.  The big problem here is that document.write() is not compatible with this method.  Unfortunately, 100% of ads out there are written out with document.write() by ad servers, regardless of whether they were written that way.</p>
<p>I&#8217;ve tried overriding document.write().  Last I checked, it actually works in Firefox:</p>
<p><code><br />
(function(){<br />
  var els = document.getElementsByTagName('*'),<br />
      el = els[els.length - 1];<br />
      adURL = 'http://ad-server.com/blah';<br />
  document.write = function(str) {<br />
    if (typeof str != 'undefined') {<br />
      var newEl = document.createElement('span');<br />
      newEl.innerHTML = str;<br />
      var nodes = newEl.childNodes;<br />
      while (nodes.length) {<br />
        el.parentNode.appendChild(nodes[0]);<br />
      }<br />
    }<br />
  }<br />
  YAHOO.util.Get.script(adURL, {<br />
    onSuccess: function(){document.write = dwrite;}<br />
  });<br />
})();<br />
</code></p>
<p>Guess how that pans out in IE?</p>
<p>(Yes, there are some flaws in the above code, but it was proof-of concept.)</p>
<p>And no, <a href="http://www.quirksmode.org/js/placejs.html">the defer attribute does not work</a> when using document.write() and <a href="http://javascript.crockford.com/script.html">should be avoided</a> anyway.</p>
<h3>Invalid Markup</h3>
<p>This problem is actually a consequence of problem #1.  document.write() allows you to just toss arbitrary text and markup onto the page.  There&#8217;s nothing to stop you from slapping this onto an otherwise nice page:</p>
<p><code><br />
document.write('&lt;div&gt;Tacos&lt;/div&gt;');<br />
</code></p>
<p>This can utterly destroy a page&#8217;s layout.  All it takes is one bad ad to toss in one unmatched tag and a page&#8217;s layout will look like it got punched in the face and set on fire.  The same thing could happen using innerHTML.  However, using DOM methods avoids this problem:</p>
<p><code><br />
var div = document.createElement('div');<br />
adSpan.appendChild(div);<br />
div.appendChild(document.createTextNode('Tacos'));<br />
</code></p>
<p>Yes, that appears to be more work.  If your gripe with this solution is that you have to type more, please allow me to do to your face what a stray closing div can do to a page.</p>
<p>Mistakes can be made when doing it this way, but it eliminates an entire category of error that can sometimes be fairly difficult to track down.  Even if you made 100% sure that your ad doesn&#8217;t output invalid html, all it takes is one person in the chain to do a bad copy &#038; paste job to hose it up.  It happens.  It costs money and wastes time.  It also makes me want to make the streets run red with the blood of my enemies.</p>
<p>Iframes, sadly, are not a solution to this problem.  While it would contain the bad markup, they make certain type of ads hard or impossible to do.  There is also a very long-standing Firefox bug in which iframes magically swap contents with each other.</p>
<h3>What Can Be Done?</h3>
<p>So where can we go from here?  I wish I knew.  I don&#8217;t think it&#8217;s realistic to expect that everyone writing ads out there change the way they write them.  Maybe someone with Google&#8217;s clout could do this, but I can&#8217;t imagine that that would end well even for Google.</p>
<p>To make matters worse, whether the ad author avoids document.write() or not is actually irrelevant at this point because ad servers like DoubleClick actually take your ad code and document.write() it — leading to the silly (but common):</p>
<p><code><br />
document.write('&lt;noscript&gt;Blah blah blah&lt;/noscript&gt;');<br />
</code></p>
<p>Overriding document.write() would be a good intermediate step if it worked in IE, but it doesn&#8217;t.</p>
<p>This really is a serious problem.  I can&#8217;t imagine how much potential revenue is lost to slow rendering pages as a result of ads which were supposed to generate revenue in the first place, not to mention the actual money spent on tracking down bad ads that are hosing up a page&#8217;s layout.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2010/01/08/whats-wrong-with-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Get.script Manager</title>
		<link>http://www.povert.com/2009/08/21/yui-get-script-manager/</link>
		<comments>http://www.povert.com/2009/08/21/yui-get-script-manager/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 22:14:01 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[yGetMan]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=885</guid>
		<description><![CDATA[I threw this together for some extra-curricular activities at work. Figured someone may find it useful. I put it under a BSD license, so feel free to do what you want with it. yGetMan is a simple queue manager for YUI&#8217;s Get.script. If you request a script that&#8217;s already been loaded, it doesn&#8217;t attempt to [...]]]></description>
			<content:encoded><![CDATA[<p>I threw this together for some extra-curricular activities at work.  Figured someone may find it useful.</p>
<p>I put it under a <a href="http://www.povert.com/fun/ygetman/license.txt">BSD license</a>, so feel free to do what you want with it.</p>
<p>yGetMan is a simple queue manager for YUI&#8217;s Get.script.  If you request a script that&#8217;s already been loaded, it doesn&#8217;t attempt to re-load that script.  Whether this is useful to you depends on your environment and circumstances.</p>
<p>See it in action <a href="http://www.povert.com/fun/ygetman/example.html">here</a>.</p>
<p>Here it is: <a href="http://www.povert.com/fun/ygetman/yGetMan.js">yGetMan</a>.  Also, <a href="http://www.povert.com/fun/ygetman/yGetMan-min.js">minified</a>.  Comments in there explain usage.</p>
<p>Also, if someone creates a mascot — a Get Man, if you will — I will make a big deal out of this and celebrate with a big plate of spaghetti.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2009/08/21/yui-get-script-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS-centric JS</title>
		<link>http://www.povert.com/2008/09/11/css-centric-js/</link>
		<comments>http://www.povert.com/2008/09/11/css-centric-js/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 20:29:26 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=793</guid>
		<description><![CDATA[This probably isn&#8217;t news to anyone deep in JS/CSS land, but I thought these notes may be handy for someone who&#8217;s still figuring out the best way to approach some problems. There&#8217;s a temptation, I think, to go overboard with JS when manipulating elements on a page. Many tasks can be more simply handled with [...]]]></description>
			<content:encoded><![CDATA[<p>This probably isn&#8217;t news to anyone deep in JS/CSS land, but I thought these notes may be handy for someone who&#8217;s still figuring out the best way to approach some problems.</p>
<p>There&#8217;s a temptation, I think, to go overboard with JS when manipulating elements on a page.  Many tasks can be more simply handled with a combination of JS and CSS.</p>
<p>For example, let&#8217;s say you have a simple unordered list:<br />
<code><br />
&lt;ul id="happyList"&gt;<br />
&nbsp;&nbsp;&lt;li&gt;&lt;a href="tacos.html"&gt;Tacos&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&lt;li&gt;&lt;a href="burritos.html"&gt;Burritos&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&lt;li&gt;&lt;a href="enchiladas.html"&gt;Enchiladas&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&lt;li&gt;&lt;a href="tamales.html"&gt;Tamales&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&lt;li&gt;&lt;a href="chalupas.html"&gt;Chalupas&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&lt;li&gt;&lt;a href="antacids.html"&gt;Antacids&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
</code></p>
<p>Let&#8217;s say that you only want 3 items to show by default, and you want a &#8220;More&#8221; link at the bottom that will expand the list to show the rest.</p>
<p>There&#8217;s a few ways you could approach this.  People may be tempted to put an onclick event onto the &#8220;More&#8221; link, then have that call a function that toggles the visibility of each element after the third.  Something like:</p>
<p><code><br />
var happy = document.getElementById('happyList');<br />
var items = happy.getElementsByTagName('li');<br />
function showLinks() {<br />
&nbsp;&nbsp;for (var i=3; i &lt; items; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;items[i].style.display = 'list-item';<br />
&nbsp;&nbsp;}<br />
}<br />
function hideLinks() {<br />
&nbsp;&nbsp;for (var i=3; i &lt; items; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;items[i].style.display = 'none';<br />
&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p>That would work (though I haven&#8217;t actually tested this particular js), but it&#8217;s definitely the crappy way, for a number of reasons.  First, there&#8217;s no need for two functions, though that&#8217;s beside the point of this post.  Second, we&#8217;re running through a for() loop every time each function is called.</p>
<p>Instead of something like that, the way I&#8217;d do it is to first set up this CSS:</p>
<p><code><br />
#happyList.collapsed li {<br />
&nbsp;&nbsp;display: none;<br />
}<br />
#happyList.collapsed li.alwaysShow {<br />
&nbsp;&nbsp;display: list-item;<br />
}<br />
</code></p>
<p>Then, you put a class of &#8216;alwaysShow&#8217; on the first three list item elements, either in the html itself or with javascript:</p>
<p><code><br />
function assignShow() {<br />
&nbsp;&nbsp;var happy = document.getElementById('happyList');<br />
&nbsp;&nbsp;var items = happy.getElementsByTagName('li');<br />
&nbsp;&nbsp;for (var i=0; i &lt; items.length &#038;&#038; i &lt; 3; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;items[i].className = 'alwaysShow';<br />
&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p>Now, when the ul has a class of &#8216;collapsed&#8217;, only the first three items show:</p>
<p><code><br />
function toggleList() {<br />
&nbsp;&nbsp;var happy = document.getElementById('happyList');<br />
&nbsp;&nbsp;if (happy.className == 'collapsed') {<br />
&nbsp;&nbsp;&nbsp;&nbsp;happy.className = '';<br />
&nbsp;&nbsp;} else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;happy.className = 'collapsed';<br />
&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p>Or, more succinctly:<br />
<code><br />
function toggleList() {<br />
&nbsp;&nbsp;var happy = document.getElementById('happyList');<br />
&nbsp;&nbsp;happy.className = happy.className ==<br />
&nbsp;&nbsp;&nbsp;&nbsp;'collapsed' ? '' : 'collapsed';<br />
}<br />
</code></p>
<p>Then, either in HTML or using javascript, you can add an element with the &#8220;More&#8221; text and attach an event to it that calls toggleList().</p>
<p>I&#8217;m being a little vague on details here.  My main point is that it&#8217;s preferable to lean on CSS as much as possible.  It helps to avoid micromanaging elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2008/09/11/css-centric-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Resizing of Cross-Domain Iframes</title>
		<link>http://www.povert.com/2008/05/19/dynamic-resizing-of-cross-domain-iframes/</link>
		<comments>http://www.povert.com/2008/05/19/dynamic-resizing-of-cross-domain-iframes/#comments</comments>
		<pubDate>Mon, 19 May 2008 21:31:06 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[WWW]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[resize]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=770</guid>
		<description><![CDATA[If you&#8217;ve ever wanted to have an iframe resize itself based on its (cross-domain) contents, you may have run into some problems. I had to tackle this somewhat recently. The solution is silly, but it works. The problem is that an iframe can&#8217;t communicate with its parent if they&#8217;re on different domains. For example, let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever wanted to have an iframe resize itself based on its (cross-domain) contents, you may have run into some problems.</p>
<p>I had to tackle this somewhat recently.  The solution is silly, but it works.</p>
<p>The problem is that an iframe can&#8217;t communicate with its parent if they&#8217;re on different domains.  For example, let&#8217;s say I put an iframe here on povert.com.  The iframe could be pointing to, say, flappingcrane.com.  Povert.com can&#8217;t access any useful information about the iframe, and vise-versa.</p>
<p>The solution is to have the iframed content (in this case flappingcrane.com) iframe something else from the original domain.  So you could set up a file on povert.com called yaygo.html.  Then flappingcrane.com iframes that, <strong>with a GET query</strong>.  That GET query should contain any information you want to communicate to the parent (povert.com).  Since yaygo.html is on povert.com, it can refer to povert.com with <strong>parent</strong> (though, since they&#8217;re different domains, it can&#8217;t do anything useful) and to flappingcrane.com with <strong>parent.parent</strong>.  Because they&#8217;re on the same domain (even with the intermediate flappingcrane.com iframe), it can do something useful &#8212; like pass values from the GET query to a function:</p>
<p><code style="font-size: 85%;"><br />
parent.parent.setFunProps(iframeid, width, height, tacoflavor);<br />
</code></p>
<p>setFunProps() can then take those values and do what it wants with it (resize the iframe, whatever).</p>
<p>Another tidbit.  If you give a <strong>name</strong> attribute to an iframe, that iframe&#8217;s contents can access the name with <strong>window.name</strong>.  You can&#8217;t access <strong>window.id</strong> though, unfortunately.  Either are handy for identifying to the parent document what iframe is requesting a resize, though there are other crappier ways to do it (passing its own url to match against iframe src, for example).</p>
<p><strong>UPDATE</strong>: As I mention in <a href="#comment-11817">my comment below</a>, you can see an example of this at <a href="http://povert.com/fun/iframe/">http://povert.com/fun/iframe/</a>.</p>
<p><strong>UPDATE (Oct 28, 2009)</strong>: Looks like it doesn&#8217;t work in any version of IE now.  It&#8217;s possible that Microsoft saw this as a security hole and fixed it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2008/05/19/dynamic-resizing-of-cross-domain-iframes/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Strudel, new Feed, S3</title>
		<link>http://www.povert.com/2008/04/16/strudel-new-feed-s3/</link>
		<comments>http://www.povert.com/2008/04/16/strudel-new-feed-s3/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 04:16:15 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Flapping Crane]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=765</guid>
		<description><![CDATA[&#8220;Toaster Strudel&#8221; is available at Flapping Crane&#8217;s music section. Good stuff. I use part of it for one of my ringtones. Also, I&#8217;ve revamped the Flapping Crane RSS feed. This sucker now has MP4 videos that are good for watching on TV (with Apple TV or probably XBox 360) or on an iPhone. Haven&#8217;t tested [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Toaster Strudel&#8221; is available at <a href="http://flappingcrane.com/music/">Flapping Crane&#8217;s music section</a>.  Good stuff.  I use part of it for one of my ringtones.</p>
<p>Also, I&#8217;ve revamped the Flapping Crane RSS feed.  This sucker now has MP4 videos that are good for watching on TV (with Apple TV or probably XBox 360) or on an iPhone.  Haven&#8217;t tested it on other iPods.  May not work on them.</p>
<p>Finally, I&#8217;m in the process of compressing new versions of all our old videos and uploading them to <a href="http://www.amazon.com/s3/">Amazon&#8217;s S3</a>.  This should allow for faster downloads.</p>
<p>I haven&#8217;t flipped the switch on S3 yet, and probably won&#8217;t for a while.  I want to get as many vids on there as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2008/04/16/strudel-new-feed-s3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worst HTML/CSS/JS</title>
		<link>http://www.povert.com/2007/11/09/worst-htmlcssjs/</link>
		<comments>http://www.povert.com/2007/11/09/worst-htmlcssjs/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 17:45:15 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Tech & Science]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[Weird and Funny]]></category>

		<guid isPermaLink="false">http://www.povert.com/2007/11/09/worst-htmlcssjs/</guid>
		<description><![CDATA[I&#8217;ve been working on what I believe may be some of the worst and most offensive (but still &#8220;working&#8221;) use of HTML, CSS and Javascript possible. You know, for fun. Here&#8217;s what I&#8217;ve got so far (line breaks added for *cough* legibility): &#60;SCRIPT LANGUAGE=JSCRIPT&#62; eval("document.write('&#60;!--[IF LT IE 9]&#62; &#60;STYLE&#62;*LI#BLUENAV{ _ZOOM:1!IMPORTANT*BACKGROUND-COLOR: PAPAYAWHIP!IMPORTANT&#60;![ENDIF]--&#62;&#60;/STYLE&#62; &#60;BASEFONT SIZE=30 COLOR=YELLOWGREEN FACE=GEORGIA&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on what I believe may be some of the worst and most offensive (but still &#8220;working&#8221;) use of HTML, CSS and Javascript possible.  You know, for fun.</p>
<p>Here&#8217;s what I&#8217;ve got so far (line breaks added for *cough* legibility):</p>
<p><code><br />
&lt;SCRIPT LANGUAGE=JSCRIPT&gt;<br />
eval("document.write('&lt;!--[IF LT IE 9]&gt;<br />
&lt;STYLE&gt;*LI#BLUENAV{<br />
_ZOOM:1!IMPORTANT*BACKGROUND-COLOR:<br />
PAPAYAWHIP!IMPORTANT&lt;![ENDIF]--&gt;&lt;/STYLE&gt;<br />
&lt;BASEFONT SIZE=30 COLOR=YELLOWGREEN FACE=GEORGIA&gt;<br />
&lt;TABLE CELLPADDING=10 CELLSPACING=10 BORDER=20&gt;<br />
&lt;TD&gt;&lt;U&gt;&lt;TABLE&gt;&lt;S&gt;&lt;LI ID=BLUENAV&gt;<br />
&lt;FONT FACE=VERDANA STYLE=FONT-SIZE:LARGE&gt;<br />
&lt;B&gt;&lt;CENTER&gt;&lt;MARQUEE BGCOLOR=MISTYROSE WIDTH=50%&gt;<br />
Tacos&lt;/MARQUEE&gt;&lt;BR&gt;<br />
&lt;IMG ALIGN=LEFT SRC=SPACER.GIF WIDTH=200 HEIGHT=20&gt;')")<br />
&lt;/SCRIPT&gt;&lt;NOSCRIPT&gt;&lt;A HREF=HTTP://MICROSOFT.COM&gt;<br />
&lt;FONT FACE=COURIER COLOR=SADDLEBROWN&gt;<br />
YOU&NBSP;NEED&NBSP;INTERNET&NBSP;EXPLORER&NBSP;TO&NBSP;<br />
EXPERIENCE&NBSP;THIS&NBSP;WEB&NBSP;SITE&NBSP;<br />
AS&NBSP;INTENDED<br />
</code></p>
<p>To see it in action, click <a href="/fun/worst.html">here</a>.  You&#8217;ll need IE, of course.  It wouldn&#8217;t be as crappy otherwise.</p>
<p>Key points:</p>
<ul>
<li>&lt;script&gt; has a LANGUAGE attribute.  And it&#8217;s JSCRIPT, for fun.</li>
<li>Elements are closed only when absolutely necessary</li>
<li>No quotes around element attributes</li>
<li>Nearly everything in uppercase</li>
<li>eval()</li>
<li>document.write()</li>
<li>Needlessly nested (and otherwise unnecessary) tables</li>
<li>Not a &lt;tr&gt; to be found.</li>
<li>Insane colors: PapayaWhip, MistyRose, YellowGreen and SaddleBrown</li>
<li>&lt;basefont&gt; and &lt;font&gt;</li>
<li>&lt;li&gt; without a &lt;ul&gt; or &lt;ol&gt;</li>
<li>&lt;noscript&gt; &#8212; some people may argue with me about this one, but it&#8217;s certainly not an indicator of whether the viewer is using IE</li>
<li>Pointless use of &amp;nbsp;</li>
<li>&lt;marquee&gt;</li>
<li>&lt;u&gt;, &lt;s&gt;, &lt;b&gt; and &lt;center&gt;</li>
<li>IE conditional comments (useful, but crappy nonetheless)</li>
<li>* and _ CSS hacks</li>
<li>!important</li>
<li>Improperly formatted (but working) css</li>
<li>Opening &lt;style&gt; tag inside conditional comment, closing tag outside.</li>
<li>No DOCTYPE</li>
<li>No attempt at an even reasonably structured HTML document &#8212; no &lt;html&gt;, no &lt;head&gt;, no &lt;body&gt;, etc.</li>
<li>Oh, and SPACER.GIF doesn&#8217;t exist, of course.  That&#8217;s a double-whammy, actually.  Spacer images blow.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2007/11/09/worst-htmlcssjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE 6 Can Get Punched by a Goat</title>
		<link>http://www.povert.com/2007/01/29/ie-6-can-get-punched-by-a-goat/</link>
		<comments>http://www.povert.com/2007/01/29/ie-6-can-get-punched-by-a-goat/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 02:33:20 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Tech & Science]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://www.povert.com/2007/01/29/ie-6-can-get-punched-by-a-goat/</guid>
		<description><![CDATA[Ran into an interesting javascript problem today. One of our programmers wrote a script which grabbed some external data and formatted it into a table. Straightforward stuff. He opted for the W3C DOM method. I advised against it, simply because that route is a pain when it comes to IE 6 in my experience. For [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into an interesting javascript problem today.</p>
<p>One of our programmers wrote a script which grabbed some external data and formatted it into a table.  Straightforward stuff.  He opted for the W3C DOM method.  I advised against it, simply because that route is a pain when it comes to IE 6 in my experience.</p>
<p>For those of you who don&#8217;t know, it&#8217;s kind of similar to writing normal HTML, except it&#8217;s done dynamically.  So you typically start by creating a node:</p>
<p><code>yaytable = document.createElement("table");</code></p>
<p>Even if you don&#8217;t know javascript but you know some HTML you can pick it up.  You then create the row:</p>
<p><code>yayrow = document.createElement("tr");</code></p>
<p>and the cell for the data that goes in one of the columns:</p>
<p><code>yaycell = document.createElement("td");</code></p>
<p>Then you create the node that contains whatever data you want to put in there:</p>
<p><code>yaydata = document.createTextNode("Whee!");</code></p>
<p>Then you can slap them all together:</p>
<p><code>yaycell.appendChild(yaydata);<br />
yayrow.appendChild(yaycell);<br />
yaytable.appendChild(yayrow);<br />
document.body.appendChild(yaytable);</code>
<p>So far, so good.  In firefox, this results in:</p>
<p><code>&lt;table&gt;&lt;tr&gt;&lt;td&gt;Whee!&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code>
<p>Yay, a dynamically generated table.  Now, there&#8217;s an easier way to do this &#8212; one that makes a lot of us web guys a little ill:</p>
<p><code style="text-align: left;">document.body.innerHTML += "&lt;table&gt;&lt;tr&gt;&lt;td&gt;Whee!&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";</code>
<p>A lot quicker.  But it&#8217;s not part of the standard, and it comes with its own drawbacks.</p>
<p>Anyway, like I said, he used the first method.  It&#8217;s a neat way to do it.  You can, for example, do something like &#8212; yayrow.style.backgroundColor = &#8216;red&#8217;; &#8212; or something later on.  Using the innerHTML way, you really just have to rewrite the string, which is inconvenient.
</p>
<p>A quick note &#8212; I&#8217;m sure that this simple example would probably work in IE 6.  However, in his case, it did not work.  I&#8217;m really not sure why.  You could look at the dom in IE and <i>see</i> the table in there, along with all of the data.  You could pull up a javascript console and output the contents of (for example) yaytable.innerHTML and you could see it.  But it wasn&#8217;t visible on the page.  It worked fine in Firefox, of course.</p>
<p>He struggled with it for a good long time.  I won&#8217;t say how long.  Eventually I told him that since it was a quick job, he really should go the easy route, propriety be damned.  It would have taken all of 10 minutes, if that.</p>
<p>Still, he had spent a lot of time on it.  Understandably, he wasn&#8217;t ready to scrap it.</p>
<p>I eventually figured out a way to do it.  It&#8217;s ironic and stupid.  Basically, tack something like this on to the end of the previous code:</p>
<p><code>crap = yaytable.innerHTML;<br />
yaytable.innerHTML = crap;</code></p>
<p>And, I shit you not, it worked.  I think I know why, but it still doesn&#8217;t explain why there was a problem in the first place.</p>
<p>Anyway, I guess the point in all this is that yeah, there is a &#8220;right&#8221; way to do things.  And it should work.  And people who haven&#8217;t spent nearly every day for years struggling to get IE 6 to do even the simplest things scoff when you tell them to not expect reasonable behavior from it.  I get that from people all the time.  Luckily, sometime after I turned 26 or so, I stopped caring when people thought I was an idiot.  If you prove me wrong, yay.  Makes my life easier.
</p>
<p>When you&#8217;re creating something for a client, 99% of the time they don&#8217;t care how you do it.  They just want it done.  And sometimes it&#8217;s not worth the effort to try to do it the right way.</p>
<p>Not that there isn&#8217;t value in trying, of course.  There is.  I plan on figuring this out, in fact.  It&#8217;s probably something very simple that I&#8217;m overlooking, even though several people looked at this problem.  It could be due to a lot of factors.  I don&#8217;t know.</p>
<p>I ran into a similar problem a while back with flapping crane.  Check out line 149 of <a href="http://flappingcrane.com/scripts.js">scripts.js</a> sometime for a laugh (hint &#8212; use View Source).  It&#8217;s in the loadSkit() function.
</p>
<p><strong>Update:</strong> Yay, I think I found a fix.  IE seems to require a TBODY tag.  Quick example:</p>
<p><code>yaytable = document.createElement("table");<br />
yaytbody = document.createElement("tbody");<br />
yayrow = document.createElement("tr");<br />
yaycell = document.createElement("td");<br />
yaydata = document.createTextNode("Whee!");<br />
yaycell.appendChild(yaydata);<br />
yayrow.appendChild(yaycell);<br />
yaytbody.appendChild(yayrow);<br />
yaytable.appendChild(yaytbody);<br />
document.body.appendChild(yaytable);</code></p>
<p>From the <a href="http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3">spec</a>:</p>
<blockquote><p><em>The TBODY start tag is always required except when the table contains only one table body and no table head or foot sections. The TBODY end tag may always be safely omitted.</em></p></blockquote>
<p>Am I reading that wrong?  <a href="http://www.rittau.org/blog/20061120-00">More info</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2007/01/29/ie-6-can-get-punched-by-a-goat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla, nodes</title>
		<link>http://www.povert.com/2006/08/16/mozilla-nodes/</link>
		<comments>http://www.povert.com/2006/08/16/mozilla-nodes/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 05:47:50 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Tech & Science]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://www.povert.com/?p=584</guid>
		<description><![CDATA[Working on a new ajax model for flapping crane. One note for anyone who has to deal with XML cross-browser issues: Gecko browsers (Firefox, Mozilla, etc) count things like newlines and spaces in an XML file as nodes. While it adheres to spec, it is (as far as I can tell) lame and asinine. So, [...]]]></description>
			<content:encoded><![CDATA[<p>Working on a new ajax model for flapping crane.</p>
<p>One note for anyone who has to deal with XML cross-browser issues: Gecko browsers (Firefox, Mozilla, etc) count things like newlines and spaces in an XML file as nodes.  While it adheres to spec, it is (as far as I can tell) lame and asinine.  So, to filter them out, create an array something like this, assuming xmlTags is an XML object:<br />
<code>
<pre>
for (i=0;i&lt;xmlTags[i].length;i++) {
    if ( ( xmlTags[i].nodeType != 3 ) &#038;&#038; ( xmlTags[i].nodeType != 8 ) ) {
      xmlData[xmlTags[i].nodeName] = trim(xmlTags[i].firstChild.data);
    }
}
</pre>
<p></code></p>
<p>The key part is checking the node type.  Type 3 and 8 are for text nodes and comment nodes.  This only works because the nodes I care about are element nodes.</p>
<p>My original plan was to just check for the return value of xmlTags[i].firstChild, but this way seems better.</p>
<p><strong>P.S.</strong> &#8212; Sorry, here&#8217;s trim():<br />
<code>
<pre>
function trim(text) {
  try {
    return text.replace(/^\s*(.*?)\s*$/g, '$1');
  }
    catch (e) {
      return text;
    }
}
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2006/08/16/mozilla-nodes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object tag, again</title>
		<link>http://www.povert.com/2006/08/10/object-tag-again/</link>
		<comments>http://www.povert.com/2006/08/10/object-tag-again/#comments</comments>
		<pubDate>Fri, 11 Aug 2006 02:59:29 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Tech & Science]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://www.povert.com/2006/08/10/object-tag-again/</guid>
		<description><![CDATA[I talked about the ugly use of &#60;embed&#62; and &#60;object&#62; a couple months ago. I was checking up on A List Apart tonight and came across an article I had missed &#8212; Bye Bye Embed. Published a full month after I had written about it here. Bah. I coulda made it into A List Apart. [...]]]></description>
			<content:encoded><![CDATA[<p>I talked about the ugly use of <a href="http://www.povert.com/2006/06/08/object-and-embed/">&lt;embed&gt; and &lt;object&gt;</a> a couple months ago.</p>
<p>I was checking up on <a href="http://alistapart.com/">A List Apart</a> tonight and came across an article I had missed &#8212; <a href="http://alistapart.com/articles/byebyeembed">Bye Bye Embed</a>.  Published a full month after I had written about it here.  Bah.  I coulda made it into A List Apart.</p>
<p>Anyway, I did things a little differently (I don&#8217;t nest &lt;object&gt; tags), and the author is more informed about the subject.  Still, kind of cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.povert.com/2006/08/10/object-tag-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
