<?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>Eric Fickes &#187; javascript</title>
	<atom:link href="http://ericfickes.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericfickes.com</link>
	<description>Internets, Databases, Skateboards, Ice Hockeys, and Family</description>
	<lastBuildDate>Thu, 22 Jul 2010 22:45:33 +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>Expose those DOM objects real quick</title>
		<link>http://ericfickes.com/2010/01/expose-those-dom-objects-real-quick/</link>
		<comments>http://ericfickes.com/2010/01/expose-those-dom-objects-real-quick/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 06:32:44 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1028</guid>
		<description><![CDATA[I was wearing my DHTML hat the other day and wanted to share this javascript quick tip.  When I have to script DOM objects but don&#8217;t have time to figure out their goings on, I like to dump them via a for() loop.  Here&#8217;s how it works. In my html file I&#8217;ll create this small [...]]]></description>
			<content:encoded><![CDATA[<p>I was wearing my DHTML hat the other day and wanted to share this javascript quick tip.  When I have to script DOM objects but don&#8217;t have time to figure out their goings on, I like to dump them via a for() loop.  Here&#8217;s how it works.</p>
<p>In my html file I&#8217;ll create this small script.</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
function dump( objId )
{
	var domObj = document.getElementById( objId );

	// message holder
	var str = &quot;&quot;;
	// loop
	for( xx in domObj )
	{
		// append to the message
		str += xx + &quot; : &quot; + domObj[ xx ] + &quot;\n\n&quot;;

		// how long is the message?
		if( str.length &gt;= 300 )
		{
			// show it
			alert( str );

			// reset it
			str = &quot;&quot;;
		}
	}

}
&lt;/script&gt;
</pre>
<p>Next I&#8217;ll drop an html button into my page that passes the id of my desired object to the dump.</p>
<pre class="brush: xml;">
&lt;button onClick=&quot;dump('parentform')&quot;&gt;dump&lt;/button&gt;
</pre>
<p>Lastly I&#8217;ll fire up my html file, click the dump button, and hope I find what I&#8217;m looking for in the alert.</p>
<div id="attachment_1037" class="wp-caption aligncenter" style="width: 437px"><a href="http://ericfickes.com/wp-content/uploads/2010/01/js_alert_window.png" rel="lightbox[1028]"><img class="size-full wp-image-1037" title="Javascript dump alert" src="http://ericfickes.com/wp-content/uploads/2010/01/js_alert_window.png" alt="Click dump, get popup" width="427" height="504" /></a><p class="wp-caption-text">dump popup</p></div>
<p>I don&#8217;t always find what I&#8217;m looking for, but I always end up finding interesting stuff.  Especially when you run the same html file in different browsers.  I wrote a <a title="Click through the DOM using eric's javascript foreacher" href="http://www.ericfickes.com/v1/code/ef_javascript_foreacher.html" target="_blank">similar javascript dumper that writes to the page instead of an alert</a>.  This one is also interesting to see in different browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/01/expose-those-dom-objects-real-quick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
