<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: One line to rule them all</title>
	<atom:link href="http://www.zelph.com/archives/2004/09/04/one-line-to-rule-them-all/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zelph.com/archives/2004/09/04/one-line-to-rule-them-all/</link>
	<description>Aaron Barker's random bablings</description>
	<lastBuildDate>Wed, 14 Nov 2007 22:52:28 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Randy</title>
		<link>http://www.zelph.com/archives/2004/09/04/one-line-to-rule-them-all/comment-page-1/#comment-24</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Tue, 07 Sep 2004 13:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.zelph.com/archives/2004/09/04/one-line-to-rule-them-all/#comment-24</guid>
		<description>Good stuff man. I like it.

Another way to do it (this is how I have done it recently) is to check &amp; then assign like you do, but the check I do is a little different. I do a typeof() on the variable -- if it returns &#039;object&#039; then I must have the element, if it returns &#039;string&#039; then I must just have the ID, if it returns &#039;undefined&#039; then the variable has been initialized but not defined, or doesn&#039;t exist at all. 

So the one line would look like:
if(typeof(foo) != â€™objectâ€™) foo = document.getElementById(foo);

(Now that I look at it, I think it&#039;s even longer doing it this way than how you do it.)
Anyway, it&#039;s just another way of doing the same thing. Thanks for the &#039;one line&#039;.</description>
		<content:encoded><![CDATA[<p>Good stuff man. I like it.</p>
<p>Another way to do it (this is how I have done it recently) is to check &#038; then assign like you do, but the check I do is a little different. I do a typeof() on the variable &#8212; if it returns &#8216;object&#8217; then I must have the element, if it returns &#8217;string&#8217; then I must just have the ID, if it returns &#8216;undefined&#8217; then the variable has been initialized but not defined, or doesn&#8217;t exist at all. </p>
<p>So the one line would look like:<br />
if(typeof(foo) != â€™objectâ€™) foo = document.getElementById(foo);</p>
<p>(Now that I look at it, I think it&#8217;s even longer doing it this way than how you do it.)<br />
Anyway, it&#8217;s just another way of doing the same thing. Thanks for the &#8216;one line&#8217;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
