<?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>Keith Bentrup&#8217;s Portforlio &#187; JavaScript</title>
	<atom:link href="http://portfolio.keithbentrup.com/archives/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://portfolio.keithbentrup.com</link>
	<description>A brief sampling of my work</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:09:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>More performance tips</title>
		<link>http://portfolio.keithbentrup.com/archives/187</link>
		<comments>http://portfolio.keithbentrup.com/archives/187#comments</comments>
		<pubDate>Tue, 11 Aug 2009 02:06:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://portfolio.keithbentrup.com/?p=187</guid>
		<description><![CDATA[I picked up a few more performance tips from this article. Notably, to make links  consistent by case. You&#8217;re liking already doing this as a single developer or perhaps a small team, but if there are many developers, I can imagine inconsistencies.  Also you should always close your tags. If you&#8217;re writing proper [...]]]></description>
			<content:encoded><![CDATA[<p>I picked up a few more performance tips from <a href="http://msdn.microsoft.com/en-us/library/ms533020(VS.85).aspx">this article</a>. Notably, to make links  <strong>consistent by case</strong>. You&#8217;re liking already doing this as a single developer or perhaps a small team, but if there are many developers, I can imagine inconsistencies.  Also you should always close your tags. If you&#8217;re writing proper XHTML, I&#8217;m sure you already are.</p>
<p><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=high-performance-ajax-applications-1197671494632682-2&#038;stripped_title=high-performance-ajax-applications" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=high-performance-ajax-applications-1197671494632682-2&#038;stripped_title=high-performance-ajax-applications" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>
<p>From <a href="http://www.slideshare.net/julien.lecomte/high-performance-ajax-applications">this presentation</a>, I picked up a few more tidbits. Never use the <code>with</code> statement. When it&#8217;s used, the javascript processor will have to examine the object (up the prototype chain) and the scope (up the scope chain) leading to expensive look-ups. </p>
<p>Never use <code>eval</code> if possible. This includes sending javascript strings to <code>setTimeout</code> and <code>setInterval</code>. Evaluated code  must be compiled and interpreted. </p>
<p>Also <a href="http://www.julienlecomte.net/blog/2007/12/38/">this post</a> discusses the potential security concerns  and memory leaks associated with <code>innerHTML</code>.</p>
<p>Lastly, I want to point out an old tool that I was recently asked about for an IE6 problem. <a href="http://outofhanwell.com/ieleak/index.php?title=Main_Page">Drip</a> can be useful for detecting those IE6 problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://portfolio.keithbentrup.com/archives/187/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed Up Your Javascript</title>
		<link>http://portfolio.keithbentrup.com/archives/170</link>
		<comments>http://portfolio.keithbentrup.com/archives/170#comments</comments>
		<pubDate>Sat, 08 Aug 2009 13:13:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://portfolio.keithbentrup.com/archives/170</guid>
		<description><![CDATA[
My notes
Scope chains:
-Store out of scope vars as local vars esp. global b/c they&#8217;ll be last on scope chain
-Avoid with: add another obj to scope chain -&#62; local vars are now 1 step away. use local vars instead
-Be careful with try-catch: catch augments scope chain
-Use closure sparingly (add 2 contexts to the scope chain)
-Don&#8217;t forget [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/mHtdZgou0qU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/mHtdZgou0qU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>My notes</strong></p>
<p><strong>Scope chains:</strong><br />
-Store out of scope vars as local vars esp. global b/c they&#8217;ll be last on scope chain<br />
-Avoid with: add another obj to scope chain -&gt; local vars are now 1 step away. use local vars instead<br />
-Be careful with try-catch: catch augments scope chain<br />
-Use closure sparingly (add 2 contexts to the scope chain)<br />
-Don&#8217;t forget var when declaring local vars (takes longer to resolve &#038; pollutes name space)</p>
<p><strong>Data Access:</strong><br />
-Property depth matters so store in local vars if accessed more than once</p>
<p><strong>Loops:</strong><br />
-for &#8230; in  is very inefficient for iterating over aways<br />
-prevent repeated property look-ups var len = arr.length;<br />
-if you can count down to 0 which evals to false can save a second evaluation<br />
c.f. for (var i=0; i < arr.length; i++) vs. for (i = arr.length; i--;) -- 50% gain!<br />
n.b. will change order of execution<br />
-avoid values.forEach(function () {}) -- function based iteration up to 8x slower!</p>
<p><strong>DOM:</strong><br />
-HTML Collections are live! Look like arrays but aren&#8217;t<br />
-var divs = document.getElementsByTagName(&#8216;div&#8217;);<br />
-divs is not a static reference<br />
-accessing divs.length queries the # of divs on every access! up to 50-60x slower in browsers<br />
-minimize property access<br />
-if you need to access in order as a snapshot, copy it to a static array</p>
<p><strong>DOM reflow:</strong><br />
-reflow: how size is calculated in browsers<br />
-reflow occurs on initial page load, browser resized, DOM nodes added/removed, new styles applied, <em>layout info retrieved</em></p>
<p><strong>DocumentFragment:</strong><br />
-DocumentFragment: doc-like object but not visually represented, considered child of doc from which it&#8217;s created,<br />
-DocumentFragment when passed to addChild, adds children to DOM<br />
ex. var frag = document.createDocumentFragment();<br />
use doc frags to reflow once instead of for every added node<br />
-alt method: if container element of elements to be added has display:none, will not reflow, then can set display: &#8221; as last step. caution: IE may still calc reflow even with display: none</p>
<p><strong>CSS:</strong><br />
-minimize changes to style property, each change causes reflow<br />
-define classes with all changes and just change className property<br />
-if retrieving layout info, can save value to var to access once </p>
]]></content:encoded>
			<wfw:commentRss>http://portfolio.keithbentrup.com/archives/170/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Web Technologies To Optimize Workflow For Repetive, Online Tasks</title>
		<link>http://portfolio.keithbentrup.com/archives/72</link>
		<comments>http://portfolio.keithbentrup.com/archives/72#comments</comments>
		<pubDate>Thu, 25 Jun 2009 08:17:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://portfolio.keithbentrup.com/?p=72</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<div style="width:425px;text-align:left" id="__ss_1650516"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=casestudy-090628045634-phpapp02&#038;stripped_title=case-study-1650516" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=casestudy-090628045634-phpapp02&#038;stripped_title=case-study-1650516" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://portfolio.keithbentrup.com/archives/72/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Listing Manager Web Application: Overview &amp; Agent Documentation</title>
		<link>http://portfolio.keithbentrup.com/archives/3</link>
		<comments>http://portfolio.keithbentrup.com/archives/3#comments</comments>
		<pubDate>Wed, 24 Jun 2009 13:17:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Script.aculo.us]]></category>
		<category><![CDATA[Slideshow]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://portfolio.keithbentrup.com/?p=3</guid>
		<description><![CDATA[
Above: the original documentation / presentation for agents. The live presentation covered use of the web application and best practices for online promotion of their clients&#8217; listings. For best results, use the full screen button to view the slideshow.
Heavily modified component of Joomla! CMS
Provides real estate professionals with quick &#8220;listing sites&#8221; and management of their [...]]]></description>
			<content:encoded><![CDATA[<div style="width: 425px; text-align: left;"><object style="margin:0px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sellyourlistings-090303225901-phpapp02&amp;stripped_title=sell-your-listings" /><param name="allowfullscreen" value="true" /><embed style="margin:0px" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sellyourlistings-090303225901-phpapp02&amp;stripped_title=sell-your-listings" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>Above: the original documentation / presentation for agents. The live presentation covered use of the web application and best practices for online promotion of their clients&#8217; listings. For best results, <strong>use the full screen button to view the slideshow</strong>.</p>
<p>Heavily modified component of Joomla! CMS</p>
<p>Provides real estate professionals with quick &#8220;listing sites&#8221; and management of their listings.</p>
<p>Front-end technologies include <a href="http://www.php.net">PHP</a>, <a href="http://www.w3.org/TR/REC-html40/">HTML</a>, <a href="http://www.w3.org/Style/CSS/">CSS</a>, <a href="http://www.adobe.com/products/flashplayer/">Flash</a>, <a href="http://en.wikipedia.org/wiki/Ajax_(programming)">Ajax</a> running on <a href="http://en.wikipedia.org/wiki/Linux">Linux</a>, <a href="http://www.apache.org/">Apache</a>, <a href="http://www.mysql.com/">MySQL</a>, and <a href="http://www.php.net/">PHP</a> back-end.</p>
<p>Interesting UI components include:</p>
<ul>
<li>time saving multiple file upload (via <a href="http://www.adobe.com/products/flashplayer/">Flash</a>) bypassing browser&#8217;s single file upload mode.</li>
<li>automatic integration of <a href="http://www.youtube.com">YouTube</a> listing videos</li>
<li><a href="http://developer.yahoo.com/yui/editor/">rich text editor</a> for user input</li>
<li>visually attractive, sophisticated <a href="http://www.adobe.com/products/flashplayer/">Flash</a> mortgage calculator</li>
<li>automatic <a href="http://maps.google.com/">Google Maps</a> interactivity</li>
<li>javascript slideshow in lightbox with shadow overlay</li>
<li><a href="http://en.wikipedia.org/wiki/Ajax_(programming)">Ajax</a> user contact form</li>
<li>agent backup with one click zip and download</li>
<li>1 click sharing and promotion via integration of social bookmarking tool <a href="http://www.addthis.com">AddThis</a></li>
<li>optimized content delivery following best pratices guidelines of <a href="http://developer.yahoo.com/yslow/help/#guidelines">YSlow</a> and <a href="http://code.google.com/speed/page-speed/">Google Page Speed</a></li>
<li>combined, minified, and cached <a href="http://www.w3.org/Style/CSS/">CSS</a> &amp; <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> using <a href="http://code.google.com/p/minify/">minify</a> &amp; <a href="http://developer.yahoo.com/yui/compressor/">YUI comprosser</a>, <a href="http://www.alistapart.com/articles/sprites/">sprited images</a>, and <a href="http://en.wikipedia.org/wiki/Lazy_loading">lazy loading</a> of specific components</li>
<li>time saving automatic fetching, parsing, and form populating based on single unique identifiers</li>
<li>Separate administrative and agent views</li>
<li>Ajax <a href="http://developer.yahoo.com/yui/autocomplete/">autocomplete</a> fields</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://portfolio.keithbentrup.com/archives/3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>www.TheHollowAtFoxValley.com</title>
		<link>http://portfolio.keithbentrup.com/archives/47</link>
		<comments>http://portfolio.keithbentrup.com/archives/47#comments</comments>
		<pubDate>Tue, 23 Jun 2009 22:19:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Script.aculo.us]]></category>
		<category><![CDATA[Video editing]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://portfolio.keithbentrup.com/archives/47</guid>
		<description><![CDATA[The Hollow At Fox Valley
]]></description>
			<content:encoded><![CDATA[<div style="width:425px;text-align:left" id="__ss_1635438"><a  target="_blank" href="http://www.thehollowatfoxvalley.com" title="The Hollow At Fox Valley">The Hollow At Fox Valley</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=thehollowatfoxvalley-090624165601-phpapp01&#038;stripped_title=the-hollow-at-fox-valley" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=thehollowatfoxvalley-090624165601-phpapp01&#038;stripped_title=the-hollow-at-fox-valley" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://portfolio.keithbentrup.com/archives/47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
