<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://coffeeonthekeyboard.com/wp-atom.php">
	<title type="text">Coffee on the Keyboard</title>
	<subtitle type="text">Technical 2.0</subtitle>

	<updated>2009-07-09T14:30:34Z</updated>
	<generator uri="http://wordpress.org/" version="2.8">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://coffeeonthekeyboard.com" />
	<id>http://coffeeonthekeyboard.com/feed/atom/</id>
	

			<link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-sa/3.0/" /><link rel="self" href="http://feeds.feedburner.com/coffeeonthekeyboard" type="application/atom+xml" /><feedburner:emailServiceId>coffeeonthekeyboard</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcoffeeonthekeyboard" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcoffeeonthekeyboard" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcoffeeonthekeyboard" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/coffeeonthekeyboard" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcoffeeonthekeyboard" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fcoffeeonthekeyboard" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcoffeeonthekeyboard" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[Google Loves Competition]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/_JkUwpzkvKs/" />
		<id>http://coffeeonthekeyboard.com/?p=244</id>
		<updated>2009-07-08T20:12:08Z</updated>
		<published>2009-07-09T14:30:34Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="chrome" /><category scheme="http://coffeeonthekeyboard.com" term="competition" /><category scheme="http://coffeeonthekeyboard.com" term="economy" /><category scheme="http://coffeeonthekeyboard.com" term="google" /><category scheme="http://coffeeonthekeyboard.com" term="market" /><category scheme="http://coffeeonthekeyboard.com" term="microsoft" /><category scheme="http://coffeeonthekeyboard.com" term="news" /><category scheme="http://coffeeonthekeyboard.com" term="operating system" /><category scheme="http://coffeeonthekeyboard.com" term="os" /><category scheme="http://coffeeonthekeyboard.com" term="reaction" />		<summary type="html"><![CDATA[Google has announced a new Chrome-based operating system. Of course, if you read blogs like mine, there&#8217;s no way you didn&#8217;t already know that.
It amazes me how many people assume Google wants to drive Microsoft out of business. From a ZDNet article: &#8220;The Chrome OS is a direct attack against Microsoft’s lucrative &#8211; albeit vulnerable [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/google-loves-competition-244/">&lt;p&gt;&lt;a href="http://news.google.com/news?q=google+os"&gt;Google has announced&lt;/a&gt; a new Chrome-based operating system. Of course, if you read blogs like mine, there&amp;#8217;s no way you didn&amp;#8217;t already know that.&lt;/p&gt;
&lt;p&gt;It amazes me how many people assume Google wants to drive Microsoft out of business. From &lt;a href="http://blogs.zdnet.com/BTL/?p=20815"&gt;a ZDNet article&lt;/a&gt;: &amp;#8220;The Chrome OS is a direct attack against Microsoft’s lucrative &amp;#8211; albeit vulnerable &amp;#8211; Windows operating system.&amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;#8220;Lucrative?&amp;#8221; Isn&amp;#8217;t Google&amp;#8217;s OS free? &amp;#8220;Vulerable?&amp;#8221; Most people &lt;a href="http://www.youtube.com/watch?v=o4MwTvtyrUQ"&gt;don&amp;#8217;t know enough&lt;/a&gt; to change browsers, let alone operating systems. &lt;a href="http://linuxhaters.blogspot.com/2008/07/fallacy-of-choice.html"&gt;Most of them&lt;/a&gt; want it to &amp;#8220;just work,&amp;#8221; not to be forced to learn new things.&lt;/p&gt;
&lt;p&gt;Maybe, deep inside Google, in the minds of some of its most hardcore decision makers, Microsoft is the evil empire, to be vanquished heroically. But on a more realistic level, I think Google is happier when there&amp;#8217;s &lt;em&gt;more&lt;/em&gt; competition, not less. If you listen to many of the comments surrounding the release of Chrome and its source code, there is a distinct sense that Google itself is better off if there are a dozens major browsers, all competing and driving standards adoption and development.&lt;/p&gt;
&lt;p&gt;So too, I think, with operating systems. Google is designing an open-source system that will, hopefully, lead to the creation of additional platforms and push others to make their user experiences better.&lt;/p&gt;
&lt;p&gt;Google isn&amp;#8217;t trying to take Microsoft down, but encouraging a more competitive marketplace, in the hope that competition will keep everyone innovative and honest.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=_JkUwpzkvKs:VquRl7jgpCU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=_JkUwpzkvKs:VquRl7jgpCU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=_JkUwpzkvKs:VquRl7jgpCU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=_JkUwpzkvKs:VquRl7jgpCU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/_JkUwpzkvKs" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/google-loves-competition-244/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/google-loves-competition-244/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/google-loves-competition-244/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[New Information Processes]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/qdIXIOomHeM/" />
		<id>http://coffeeonthekeyboard.com/?p=237</id>
		<updated>2009-07-08T19:31:56Z</updated>
		<published>2009-07-08T19:31:56Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="Education" /><category scheme="http://coffeeonthekeyboard.com" term="information" /><category scheme="http://coffeeonthekeyboard.com" term="literacy" /><category scheme="http://coffeeonthekeyboard.com" term="Social Media" /><category scheme="http://coffeeonthekeyboard.com" term="twitter" />		<summary type="html"><![CDATA[Robert Pondiscio started a great discussion on Twitter in the classroom over on The Core Knowledge Blog. In particular, I&#8217;m interested in one of his comments:
If someone invented a 21st century hammer it wouldn&#8217;t dramatically change the training and experience a contractor would need to build a house. Nor would anyone suggest that &#8220;tool fluency&#8221; [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/new-information-processes-237/">&lt;p&gt;Robert Pondiscio started a great discussion on &lt;a href="/tag/twitter"&gt;Twitter&lt;/a&gt; in the classroom over on &lt;a href="http://www.coreknowledge.org/blog/2009/06/29/the-twitter-challenge/"&gt;The Core Knowledge Blog&lt;/a&gt;. In particular, I&amp;#8217;m interested in one of &lt;a href="http://www.coreknowledge.org/blog/2009/06/29/the-twitter-challenge/#comment-7185"&gt;his comments&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If someone invented a 21st century hammer it wouldn&amp;#8217;t dramatically change the training and experience a contractor would need to build a house. Nor would anyone suggest that &amp;#8220;tool fluency&amp;#8221; is now the soul of carpentry. And so it is with information literacy. It dramatically expands access to information. &lt;strong&gt;It doesn&amp;#8217;t change how we process it.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The emphasis is mine. Now, whether tools like Twitter or &lt;a href="http://todaysmeet.com/"&gt;Today&amp;#8217;s Meet&lt;/a&gt; are &lt;a href="http://projects.minot.k12.nd.us/groups/chris/weblog/29e37/Backchanneling_in_Middle_School_Social_Studies.html"&gt;useful in classrooms&lt;/a&gt; is a broader discussion than I want to deal with right now*, but here&amp;#8217;s a more specific question: does the way we access information alter the ways we process it?&lt;span id="more-237"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s look at the history of writing in general: &lt;a href="http://www.units.muohio.edu/technologyandhumanities/plato.htm"&gt;Socrates was against it&lt;/a&gt;. He felt that writing diminished the ability of the reader/listener to question and interact with the author/speaker, and, in an eerily familiar concern, that the written word destroy our memories. Socrates worked by his eponymous method, a rhetorical strategy of questioning to ferret out truth and expose falsehood and fallacy. When he was presented with a written argument, he was not able to evaluate its author, nor to directly question the author&amp;#8217;s deductions.&lt;/p&gt;
&lt;p&gt;Here we have a &lt;em&gt;physiological&lt;/em&gt; shift in how we process information: from listening with our ears to reading with our eyes. I&amp;#8217;m not a neurologist, but I&amp;#8217;m sure those processes involve different areas of the brain—though surely with much overlap.&lt;/p&gt;
&lt;p&gt;But more crucially, the reader typically processes much larger chunks of content than the listener. The listener is able to interrupt, clarify, disagree with any particular point.  The listener can be persuaded by discussion while the reader must accept what is written, or not. Readers who wish to respond often do so &lt;em&gt;en masse&lt;/em&gt;, with equal-length writings, rather than specific questions.&lt;/p&gt;
&lt;p&gt;The technology of writing changed how we access information, how we process it, and how we respond to it.&lt;/p&gt;
&lt;p&gt;For all the downfalls, and all of Socrates concerns, writing spread throughout the civilized world, because it has several key advantages over the oral/aural tradition. Writing can be stored for later, copied, distributed. A performance of The Iliad requires the audience to come together at a time and place; the book can be read by individuals at their leisure, passed around and carried to new places—though it loses the meter, rhythm and excitement imparted by the performer.&lt;/p&gt;
&lt;p&gt;From our historical point of view, writing enables us to create more &amp;#8220;complete&amp;#8221; works, uninterrupted by the audience, with more time to contemplate, and forces us to form arguments on a larger scale than when speaking. From Socrates point of view, those were not advantages.&lt;/p&gt;
&lt;p&gt;So, when &lt;a href="http://www.coreknowledge.org/blog/2009/06/29/the-twitter-challenge/#comment-7191"&gt;Stuart&lt;/a&gt; comments&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Many things that are really worth knowing — whether world history or human anatomy or advanced physics — will demand that a student be able to pay attention to dense texts for long periods of time, along with memorizing quite a bit of what is printed there.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;remember that the books he&amp;#8217;s praising would not, could not, exist without writing, a technology that altered our way of storing and accessing information. (And without the printing press, we wouldn&amp;#8217;t have homework, either, and kids would not be expected to read those books.)&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s stick with writing and jump ahead, way past the typewriter to the word processor. Why the word processor?&lt;/p&gt;
&lt;p&gt;If you are writing by hand, chiseling in rock, painting on papyrus, or even using a typewriter, writing and editing are essentially linear processes. You write in order. Changing the order is a cumbersome process, and nearly any edit requires a complete re-type.&lt;/p&gt;
&lt;p&gt;With the advent of the word processor, non-linear editing is possible. The way we approach, and critique, writing is so significantly different, thanks only to cut, copy, and paste, that I doubt many of us can truly appreciate the shift. Ask someone about the difference between linear and non-linear video editing and I think you may start to catch a glimpse of that shift.&lt;/p&gt;
&lt;p&gt;When the computer and word processor were first introduced, there was not an immediate productivity increase over typewriters. It took time for users&amp;#8217; methods of processing the information to adapt and assimilate the new technology, even though they keyboard was essentially unchanged. The access to information (our own writing) in a new way altered the way we processed and created that information.&lt;/p&gt;
&lt;p&gt;In the most modern era, critics of multitasking argue that accessing multiple sources of information simultaneous alters our method of processing that information (for the worse, or they wouldn&amp;#8217;t be critics). They cite &lt;abbr title="functional magnetic resonance imaging"&gt;fMRIs&lt;/abbr&gt; and other scans indicating a &lt;em&gt;physiological&lt;/em&gt; shift in information processing, stemming simply from a change in access.&lt;/p&gt;
&lt;p&gt;It is difficult to accept the claim that new methods of accessing information have no effect on our processing of that information, regardless of your opinion of social media, social networking, and/or education. The dichotomy of content and delivery is hardly clear-cut. If it were, why should teachers mind students watching a movie in lieu of reading a book? This blurring is the very basis of &amp;#8220;differentiated instruction,&amp;#8221; an admission that all processing  paths are not equal in all students.&lt;/p&gt;
&lt;p class="aside"&gt;* For the record, I agree with Mr. Pondiscio on many—if not most—points, especially with his concern that teachers spend too much time making any particular technology an end in and of itself. However, I think there is a very fine line to walk when a &lt;a href="http://mason.gmu.edu/~lsmithg/jamespaulgee2"&gt;psychosocial moratorium&lt;/a&gt; is not possible. I&amp;#8217;ll write more about modeling interactions with new tools, from e-mail to social media.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=qdIXIOomHeM:ZaBsrW_lQA0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=qdIXIOomHeM:ZaBsrW_lQA0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=qdIXIOomHeM:ZaBsrW_lQA0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=qdIXIOomHeM:ZaBsrW_lQA0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/qdIXIOomHeM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/new-information-processes-237/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/new-information-processes-237/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/new-information-processes-237/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[WP: Better Search Widget 1.1]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/juVmL2Kl4nU/" />
		<id>http://coffeeonthekeyboard.com/?p=232</id>
		<updated>2009-07-02T17:05:05Z</updated>
		<published>2009-07-02T17:05:05Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="Code" /><category scheme="http://coffeeonthekeyboard.com" term="l10n" /><category scheme="http://coffeeonthekeyboard.com" term="PHP" /><category scheme="http://coffeeonthekeyboard.com" term="release" /><category scheme="http://coffeeonthekeyboard.com" term="widget" /><category scheme="http://coffeeonthekeyboard.com" term="WordPress" />		<summary type="html"><![CDATA[Better Search Widget 1.1 is a significant upgrade to Better Search Widget that adds new features and fixes an old bug with internationalization.
Features
(New features in bold.)

Optional default value.
Optional, custom widget title.
Optional onfocus and onblur listeners.
Optional, customizable focus and blur colors.
Custom button value.
Custom field size.

The built-in search widget has only one of these features, the optional, [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/wp-better-search-widget-1-1-232/">&lt;p&gt;&lt;a href="http://coffeeonthekeyboard.com/wp-content/uploads/2009/07/better-search-widget.zip"&gt;Better Search Widget 1.1&lt;/a&gt; is a significant upgrade to &lt;a href="http://coffeeonthekeyboard.com/wp-plugin-better-search-widget-113/" title="Better Search Widget"&gt;Better Search Widget&lt;/a&gt; that adds new features and fixes an old bug with internationalization.&lt;/p&gt;
&lt;h3&gt;Features&lt;/h3&gt;
&lt;p&gt;(New features in bold.)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Optional default value&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional,&lt;/strong&gt; custom widget title&lt;strong&gt;.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional onfocus and onblur listeners.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional, customizable focus and blur colors.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Custom button value.&lt;/li&gt;
&lt;li&gt;Custom field size.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The built-in search widget has only one of these features, the optional, custom title.&lt;/p&gt;
&lt;h4&gt;Onfocus and Onblur&lt;/h4&gt;
&lt;p&gt;In order to use the blur and focus colors, you must enable the onfocus and onblur event listeners. In order to use the listeners, you must specify a default value (otherwise none of this makes sense). Here&amp;#8217;s an example:&lt;/p&gt;
&lt;div style="border: 1px solid #333; margin: 0.5em auto; padding: 0.7em 0; width: 50%; text-align: center;"&gt;
&lt;form&gt;
&lt;input style="color: #999; width: 80%;" type="text" value="Default" onfocus="this.style.color='#333';if('Default'==this.value)this.value='';" onblur="if(''==this.value){this.style.color='#999';this.value='Default'}" /&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;h3&gt;Bug Fixes&lt;/h3&gt;
&lt;p&gt;A pretty serious typo meant that none of the internationalization code worked correctly. This has been fixed, and en_US, en_GB, and fr_FR localizations are available. de_DE is coming. If you&amp;#8217;d like to translate, there is a .pot file included in the languages directory.&lt;/p&gt;
&lt;h3&gt;License&lt;/h3&gt;
&lt;p&gt;Better Search Widget is released under the &lt;a href="http://www.opensource.org/licenses/mit-license.php"&gt;MIT License&lt;/a&gt;. If you use it, or have suggestions for new features or bug fixes, let me know!&lt;/p&gt;
&lt;h3&gt;Getting It&lt;/h3&gt;
&lt;p&gt;You can download &lt;a href="http://coffeeonthekeyboard.com/wp-content/uploads/2009/07/better-search-widget.zip"&gt;Better Search Widget 1.1&lt;/a&gt; now in a Zip file. Or, to save yourself some trouble,  you can check it out of Subversion from&lt;/p&gt;
&lt;pre&gt;svn co svn://jamessocol.com/better-search-widget/tags/1.1.0 ./better-search-widget&lt;/pre&gt;
&lt;p&gt;(Run that in your &lt;code&gt;wp-content/plugins&lt;/code&gt; directory.) Subversion will make it easiest to upgrade later.&lt;/p&gt;
&lt;h3&gt;Roadmap&lt;/h3&gt;
&lt;p&gt;Soon, though probably not today, I will be releasing Better Search Widget 2, which will take advantage of the new Widget API in WordPress 2.8. This will add support for multiple instances of the widget, but will require at least WordPress 2.8. You should upgrade, anyway.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=juVmL2Kl4nU:zAglhYlyITc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=juVmL2Kl4nU:zAglhYlyITc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=juVmL2Kl4nU:zAglhYlyITc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=juVmL2Kl4nU:zAglhYlyITc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/juVmL2Kl4nU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/wp-better-search-widget-1-1-232/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/wp-better-search-widget-1-1-232/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/wp-better-search-widget-1-1-232/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[Widget l10n]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/cQHDPq-IRks/" />
		<id>http://coffeeonthekeyboard.com/?p=230</id>
		<updated>2009-07-02T04:36:43Z</updated>
		<published>2009-07-02T04:36:43Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="api" /><category scheme="http://coffeeonthekeyboard.com" term="Code" /><category scheme="http://coffeeonthekeyboard.com" term="i18n" /><category scheme="http://coffeeonthekeyboard.com" term="l10n" /><category scheme="http://coffeeonthekeyboard.com" term="WordPress" />		<summary type="html"><![CDATA[I spent some of today working on bringing a couple of WordPress widgets up-to-date (Better Search and Most Comments) only to discover there is a new widget API. I guess I haven&#8217;t been paying attention.
I&#8217;ll probably start some 2.0 branches tomorrow to take advantage of the new API. I wish I didn&#8217;t know how many [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/widget-l10n-230/">&lt;p&gt;I spent some of today working on bringing a couple of WordPress widgets up-to-date (&lt;a href="http://jamessocol.com/projects/better-search-widget.php"&gt;Better Search&lt;/a&gt; and &lt;a href="http://jamessocol.com/projects/most-comments-widget.php"&gt;Most Comments&lt;/a&gt;) only to discover there is a &lt;a href="http://codex.wordpress.org/Widgets_API#Developing_Widgets_on_2.8.2B"&gt;new widget API&lt;/a&gt;. I guess I haven&amp;#8217;t been paying attention.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll probably start some 2.0 branches tomorrow to take advantage of the new API. I wish I didn&amp;#8217;t know how many people don&amp;#8217;t keep their WordPress installations up to date, so I wouldn&amp;#8217;t care about backwards compatibility.&lt;/p&gt;
&lt;p&gt;At least both widgets got nice new, and functional, internationalization (i18n) code and new localization (l10n) files.&lt;/p&gt;
&lt;p&gt;And BSW got a good feature update, incorporating some suggestions from &lt;a href="http://mjml.de/"&gt;Marco Jung&lt;/a&gt;, who is also, kindly, doing a German localization, and a few of my own. The built-in search widget has stepped up it&amp;#8217;s game, and fixed the thing BSW was originally designed to fix (no widget title) so I have a higher bar to clear to justify the name &amp;#8220;&lt;em&gt;Better&lt;/em&gt; Search Widget.&amp;#8221;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll write up the new features tomorrow.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=cQHDPq-IRks:CNXhjiMafww:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=cQHDPq-IRks:CNXhjiMafww:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=cQHDPq-IRks:CNXhjiMafww:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=cQHDPq-IRks:CNXhjiMafww:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/cQHDPq-IRks" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/widget-l10n-230/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/widget-l10n-230/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/widget-l10n-230/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[A Personal Update]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/41pgQ-7k6VI/" />
		<id>http://coffeeonthekeyboard.com/?p=228</id>
		<updated>2009-06-19T04:23:15Z</updated>
		<published>2009-06-19T04:23:15Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" />		<summary type="html"><![CDATA[Most of my blog visitors are people trickling in from Google with questions about rebuilding PHP on RHEL, connecting PHP, IIS6 and SQL Server, or, inexplicably, looking for info on the game Crysis.
I should warn, a lot of that stuff is out of date. And I never did end up buying Crysis. (Gaming at 640&#215;480 [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/a-personal-update-228/">&lt;p&gt;Most of my blog visitors are people trickling in from Google with questions about &lt;a href="http://coffeeonthekeyboard.com/how-to-upgrade-or-recompile-php-on-rhel5-59/" title="rebuilding PHP on RHEL"&gt;rebuilding PHP on RHEL&lt;/a&gt;, &lt;a href="http://coffeeonthekeyboard.com/connecting-php-iis-6-and-sql-server-2005-129/" title="connecting PHP, IIS6 and SQL Server"&gt;connecting PHP, IIS6 and SQL Server&lt;/a&gt;, or, inexplicably, looking for info on the game &lt;a href="http://coffeeonthekeyboard.com/crysis-58/" title="Crysis"&gt;Crysis&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I should warn, a lot of that stuff is out of date. And I never did end up buying Crysis. (Gaming at 640&amp;#215;480 just isn&amp;#8217;t that fun anymore.)&lt;/p&gt;
&lt;p&gt;Anyway, given that traffic profile, I doubt most visitors will care about this. But, in case I&amp;#8217;m wrong, and I often am, I thought you deserved to know about some relatively large changes with me lately.&lt;/p&gt;
&lt;p&gt;The first and biggest: I no longer work at Michigan State University. I worked there for a year and a half as an student, and when I graduated, they kept me on as a temporary employee and then offered me a year-long contract position. That contract expired at the end of May—literally: May 31st would&amp;#8217;ve been my last day if it hadn&amp;#8217;t been a Sunday.&lt;/p&gt;
&lt;p&gt;My month-to-month lease renewed on June 3rd, so I had a choice of moving everything out very quickly or paying for an extra month. Since I was only bugging out about 100 miles to &lt;a href="http://speedchange.blogspot.com/"&gt;my father&amp;#8217;s&lt;/a&gt; place, I decided to get out quickly. (Nice for the landlord: there were already people coming to see and apply for the place before I was done packing.)&lt;/p&gt;
&lt;p&gt;And then the last week of May I needed to fly out to California.&lt;/p&gt;
&lt;p&gt;So in the span of a week, I flew to California and back, ended my job, and moved. Quite a turbulent time. A lot of things, like Twitter and this blog, fell by the wayside. Don&amp;#8217;t worry, though. I have a post about semantic form markup that&amp;#8217;s almost ready to go.&lt;/p&gt;
&lt;p&gt;The job thing: I was not particularly excited about staying in the Lansing area when it was offered, but I took it because, basically, everyone told me to. Really, I only ended up staying about 9 months longer than I&amp;#8217;d planned, but I needed to get out of the area. In the future, I may write about my experiences as support staff in a university environment (hint: I didn&amp;#8217;t love it) but for now, know that leaving was a very positive thing for me in a lot of ways.&lt;/p&gt;
&lt;p&gt;When you start to feel like &lt;a href="http://www.imdb.com/name/nm0000190/"&gt;Matthew McConaughey&lt;/a&gt; in &lt;a href="http://www.imdb.com/title/tt0106677/"&gt;Dazed and Confused&lt;/a&gt; (&amp;#8221;That&amp;#8217;s what I love about these undergrads, man. I get older; they stay the same age&amp;#8230;&amp;#8221;) it&amp;#8217;s time to move on.&lt;/p&gt;
&lt;p&gt;And, while I&amp;#8217;m not yet quite ready to talk about it, it looks like the job situation will work out very well, and very quickly. Of course, I&amp;#8217;ll have to move again.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s the story. Or at least as much as I&amp;#8217;ll tell right now. Now for some technical mumbo-jumbo.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been working on a little project—though not in the past three weeks—called &lt;a href="http://svn.jamessocol.com/cocode"&gt;Cocode&lt;/a&gt;. It&amp;#8217;s an open-source pastebin app that runs on my &lt;a href="http://svn.jamessocol.com/maveric"&gt;PHP framework, Maveric&lt;/a&gt;. Well, not quite a pastebin. More accurately, it&amp;#8217;s a tool to support internal code review. It supports user authentication, comments on code snippets, and, of course, revisions with diffs and syntax highlighting.&lt;/p&gt;
&lt;p&gt;Working on Cocode has given me a good reason to do some development on Maveric, itself. I&amp;#8217;ve added some neat &lt;abbr title="Object-Relational Mapping"&gt;ORM&lt;/abbr&gt; features and am working on a real database abstraction layer. I also want to improve routing and several other ugly bits, but, you know, one thing at a time. The changes to Maveric give me a good reason to go back and rework the application layer of &lt;a href="http://todaysmeet.com/"&gt;Today&amp;#8217;s Meet&lt;/a&gt;, as well, though I haven&amp;#8217;t done it yet. What a good time to add some of the features people request!&lt;/p&gt;
&lt;p&gt;You can check out &lt;a href="http://svn.jamessocol.com/maveric"&gt;Maveric&lt;/a&gt; and &lt;a href="http://svn.jamessocol.com/cocode"&gt;Cocode&lt;/a&gt; from Subversion, if you&amp;#8217;re curious. And if you&amp;#8217;re a PHP developer who wants to contribute, please &lt;a href="mailto:me@jamessocol.com"&gt;let me know&lt;/a&gt;. I would certainly appreciate the help and a fresh perspective. I&amp;#8217;ll post more about Cocode soon.&lt;/p&gt;
&lt;p&gt;Finally, I&amp;#8217;m working on a little WordPress plugin to help with the new rash of irrelevant comment spam I&amp;#8217;m getting. (You know the kind: they just say &amp;#8220;Great Psot!&amp;#8221; and their URL is the important part.) I&amp;#8217;ll post about that one, too.&lt;/p&gt;
&lt;p&gt;There&amp;#8217;s my life, lately, both the coding and non-coding aspects. I hope you&amp;#8217;ve enjoyed this brief, personal interlude. Next up, you&amp;#8217;re regularly scheduled geekery and social media name-calling—except on the West Coast, where you&amp;#8217;re local news is up next.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=41pgQ-7k6VI:1ul7pkMHO58:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=41pgQ-7k6VI:1ul7pkMHO58:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=41pgQ-7k6VI:1ul7pkMHO58:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=41pgQ-7k6VI:1ul7pkMHO58:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/41pgQ-7k6VI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/a-personal-update-228/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/a-personal-update-228/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/a-personal-update-228/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[JavaScript: Private Static Members, Part 2]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/Nr3dHsby-ew/" />
		<id>http://coffeeonthekeyboard.com/?p=218</id>
		<updated>2009-05-19T14:55:36Z</updated>
		<published>2009-05-19T14:55:36Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="Code" /><category scheme="http://coffeeonthekeyboard.com" term="Front-end" /><category scheme="http://coffeeonthekeyboard.com" term="javascript" />		<summary type="html"><![CDATA[Finally, it&#8217;s time to finish up the lesson on private static members and methods in JavaScript.
Last time, I introduced the technique of creating and immediately executing a function, using parentheses. I talked a little about returning a function and storing it in a variable.
var myFunc = &#40;function &#40;&#41; &#123;
&#160; return function &#40;&#41; &#123;
&#160; &#160; alert&#40;&#34;Hello, [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/">&lt;p&gt;Finally, it&amp;#8217;s time to finish up the lesson on private static members and methods in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-1-208/"&gt;Last time&lt;/a&gt;, I introduced the technique of creating and immediately executing a function, using parentheses. I talked a little about &lt;em&gt;returning&lt;/em&gt; a function and storing it in a variable.&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; myFunc = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;quot;Hello, World!&amp;quot;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;myFunc&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// &amp;quot;function () &amp;#8230; &amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;myFunc&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// Hello, World!&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span id="more-218"&gt;&lt;/span&gt;&lt;br /&gt;
There are a lot of things you can do with this trick, like create interesting &lt;a href="http://coffeeonthekeyboard.com/firefox-open-in-blank-tab-197/"&gt;bookmarklets&lt;/a&gt;. But let&amp;#8217;s see how you can use it to protect information on the class level.&lt;/p&gt;
&lt;p&gt;Here we&amp;#8217;ll take advantage of JavaScript&amp;#8217;s scope behavior. Remember that a function uses the variables where it is &lt;em&gt;defined&lt;/em&gt;, not executed. Perhaps a better example&amp;#8230;&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; myFunc = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; message = &lt;span class="st0"&gt;&amp;quot;I&amp;#8217;m hidden.&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;message&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; message = &lt;span class="st0"&gt;&amp;quot;I&amp;#8217;m visible.&amp;quot;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;myFunc&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// &amp;quot;I&amp;#8217;m hidden.&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;We can see that the inner function (which is returned from the outer function and set to &lt;code&gt;myFunc&lt;/code&gt;) uses the value of &lt;code&gt;message&lt;/code&gt; from the block where it was defined, not executed.&lt;/p&gt;
&lt;p&gt;Now you should be able to see where this is going. Let&amp;#8217;s look at a more complex example, extended from the &lt;a href="http://coffeeonthekeyboard.com/private-variables-in-javascript-177/"&gt;first part&lt;/a&gt;:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; Product = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; partNumRegex = &lt;span class="re0"&gt;/^\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;4&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;\-\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;2&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;$/&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt; num &lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; partNum = &lt;span class="kw2"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;setPartNum&lt;/span&gt; = &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt; n &lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;partNumRegex.&lt;span class="me1"&gt;test&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;n&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; partNum = n;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt; &lt;span class="kw1"&gt;else&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;false&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;getPartNum&lt;/span&gt; = &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; partNum;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;num&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;setPartNum&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;num&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw1"&gt;this&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; car = &lt;span class="kw2"&gt;new&lt;/span&gt; Product;&lt;br /&gt;
car.&lt;span class="me1"&gt;setPartNum&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;#8216;1234-56&amp;#8242;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; table = &lt;span class="kw2"&gt;new&lt;/span&gt; Product;&lt;br /&gt;
table.&lt;span class="me1"&gt;setPartNum&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;#8216;345678&amp;#8242;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;quot;Car: &amp;quot;&lt;/span&gt;+car.&lt;span class="me1"&gt;getPartNum&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// &amp;quot;Car: 1234-56&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;quot;Table: &amp;quot;&lt;/span&gt;+table.&lt;span class="me1"&gt;getPartNum&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// &amp;quot;Table: null&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;What&amp;#8217;s the advantage here? The variable &lt;code&gt;partNumRegex&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; copied by the &lt;code&gt;new&lt;/code&gt; operator. In a small example like this, there is not much benefit, but if you had hundreds of &lt;code&gt;Product&lt;/code&gt; objects, you could save a significant amount of memory.&lt;/p&gt;
&lt;p&gt;There are a few major drawbacks: a public static (class) method cannot access a private static method or variable. For example:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; Product = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; partNumRegex = &lt;span class="re0"&gt;/^\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;4&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;\-\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;2&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;$/&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// snip&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;Product.&lt;span class="me1"&gt;validPartNum&lt;/span&gt; = &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;num&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;partNumRegex.&lt;span class="me1"&gt;test&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;num&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt; &lt;span class="co1"&gt;// (1)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;The class method &lt;code&gt;validPartNum&lt;/code&gt; has no access to the private class variable &lt;code&gt;partNumRegex&lt;/code&gt;, and so will throw an error at (1). Adding an accessor &lt;em&gt;must&lt;/em&gt; be done on the &lt;em&gt;instance&lt;/em&gt;, not the class, like so:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; Product = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; partNumRegex = &lt;span class="re0"&gt;/^\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;4&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;\-\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;2&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;$/&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;getPartNumRegex&lt;/span&gt; = &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; partNumRegex;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// snip&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;p&gt;But then you cannot access the private variable without first creating an instance of the class, and the accessor function is copied with the &lt;code&gt;new&lt;/code&gt; operator. New methods added to the &lt;code&gt;Product.prototype&lt;/code&gt; object are likewise unable to access the private static variables. This is a limitation of JavaScript.&lt;/p&gt;
&lt;p&gt;Even with these limitations, the ability to hide implementation behind an agreed-upon interface is powerful. (JavaScript doesn&amp;#8217;t actually have interfaces, but you can just write it down.) Behind the scenes, you could load new data via Ajax, without ever exposing your Ajax method to that new guy down the hall who likes to misuse everything he can:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; Product = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; partNumRegex = &lt;span class="re0"&gt;/^\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;4&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;\-\d&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="nu0"&gt;2&lt;/span&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;$/&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// private static function, not copied with &amp;quot;new&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;function&lt;/span&gt; loadPartData&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;partNum&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// load data via Ajax&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; partNum = &lt;span class="kw2"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// snip&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;setPartNum&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;num&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;if&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;partNumRegex.&lt;span class="me1"&gt;test&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;num&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; partNum = num;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw2"&gt;var&lt;/span&gt; data = loadPartData&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;partNum&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;productName&lt;/span&gt; = data.&lt;span class="me1"&gt;productName&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;this&lt;/span&gt;.&lt;span class="me1"&gt;price&lt;/span&gt; = data.&lt;span class="me1"&gt;price&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt; &lt;span class="kw1"&gt;else&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;false&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// snip&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s it for now. I owe most of these three articles to the book &lt;a href="http://www.amazon.com/JavaScript-Design-Patterns-Recipes-Problem-Solution/dp/159059908X"&gt;Pro JavaScript Design Patterns&lt;/a&gt;, by Ross Harmes and Dustin Diaz. Those two are geniuses, and anyone who wants to be a better JavaScript programmer would do well to pick up their book.&lt;/p&gt;
&lt;p&gt;Next up, I&amp;#8217;ll argue why the &lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt; tag is a good way to display forms semantically.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=Nr3dHsby-ew:lKplETInKzY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=Nr3dHsby-ew:lKplETInKzY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Nr3dHsby-ew:lKplETInKzY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=Nr3dHsby-ew:lKplETInKzY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/Nr3dHsby-ew" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[Social Media Marketing: This is your Chance]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/2OZZIfZNqV8/" />
		<id>http://coffeeonthekeyboard.com/?p=215</id>
		<updated>2009-04-30T16:49:50Z</updated>
		<published>2009-04-30T16:49:50Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="Marketing" /><category scheme="http://coffeeonthekeyboard.com" term="Social Media" /><category scheme="http://coffeeonthekeyboard.com" term="twitter" />		<summary type="html"><![CDATA[If I could&#8217;ve sat down with Chris Brogan and Laura Fitton six months ago and asked them one thing, it would have been: &#8220;Who, exactly, are you marketing to?&#8221;
There has always been a small thorn in my paw about social media marketing. It&#8217;s the same thing that bothers me when people come on TV and [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/social-media-marketing-this-is-your-chance-215/">&lt;p&gt;If I could&amp;#8217;ve sat down with &lt;a href="http://www.chrisbrogan.com/"&gt;Chris Brogan&lt;/a&gt; and &lt;a href="http://pistachioconsulting.com/"&gt;Laura Fitton&lt;/a&gt; six months ago and asked them one thing, it would have been: &amp;#8220;Who, exactly, are you marketing to?&amp;#8221;&lt;/p&gt;
&lt;p&gt;There has always been a small thorn in my paw about social media marketing. It&amp;#8217;s the same thing that bothers me when people come on TV and promise to help make you rich. All you have to do is&amp;#8230; sell a book that promises to make people rich! It&amp;#8217;s the same feeling I get when I read &lt;a href="http://www.problogger.net/"&gt;Problogger&lt;/a&gt; and wonder: &amp;#8220;Do I want to listen to advice from a blog about blogging? Would I do better to listen to someone like &lt;a href="http://www.codinghorror.com/blog/"&gt;Jeff Atwood&lt;/a&gt;?&amp;#8221;&lt;span id="more-215"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For months—years—the &amp;#8220;social media space&amp;#8221; has been dominated by, well, social media users. There are lots of people, from Brogan and Pistachio on down, promising to help you leverage tools like &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt;. But who was the audience on Twitter? Early-adopters. Geeks. Other &amp;#8220;social media marketers.&amp;#8221;&lt;/p&gt;
&lt;p&gt;Of course Chris Brogan can sell himself on Twitter: it was his ideal audience. But when it comes to marketing the end product, who&amp;#8217;s listening?&lt;/p&gt;
&lt;p&gt;Twitter use has &lt;a href="http://www.techcrunch.com/2009/04/24/twitter-eats-world-global-visitors-shoot-up-to-19-million/"&gt;skyrocketed&lt;/a&gt; over the last 9 or 10 months. Once the morning shows started talking about Twitter (unfortunately, giving very &lt;a href="http://www.mcall.com/news/opinion/anotherview/all-point.6868702apr24,0,6909055.story"&gt;false impressions&lt;/a&gt;) the cascade was probably inevitable. And the people who are joining now are not the same people who joined a year and a half ago.&lt;/p&gt;
&lt;p&gt;The time for social media marketers—the real ones, dealing with consumers, not meta-marketers selling advice on selling—to prove themselves is &lt;strong&gt;right now&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is your chance.&lt;/p&gt;
&lt;p&gt;Prove to me that this can work; that what you do is worth it.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t mean to pick on Chris Brogan. I&amp;#8217;m sure his company, &lt;a href="http://crosstechmedia.com/"&gt;CrossTech Media&lt;/a&gt;, has a portfolio of successful campaigns. What &lt;em&gt;doesn&amp;#8217;t&lt;/em&gt; impress me is convincing the early adopters of the potential of the space. If there&amp;#8217;s a more apt example of &amp;#8220;preaching to the choir,&amp;#8221; I don&amp;#8217;t know it.&lt;/p&gt;
&lt;p&gt;There has been a reinforcement loop in this field. &amp;#8220;We should follow Chris Brogan, he knows what he&amp;#8217;s talking about!&amp;#8221; &amp;#8220;Chris Brogan has 18,000 followers, he must know what he&amp;#8217;s talking about!&amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;#8220;I&amp;#8217;ll subscribe to Problogger because they&amp;#8217;ll help me get more subscribers. They must be good, look how many subscribers they have!&amp;#8221;&lt;/p&gt;
&lt;p&gt;Now there is finally an opportunity to put all this theory into practice. Can you use Chris Brogan&amp;#8217;s advice to build relationships on Twitter with people who aren&amp;#8217;t already excited about building relationships on Twitter? Can you use Darren Rowse&amp;#8217;s advice to build an audience of people who aren&amp;#8217;t other bloggers?&lt;/p&gt;
&lt;p&gt;If I could sit down with Chris Brogan and Laura Fitton and Darren Rowse &lt;em&gt;now&lt;/em&gt;, I wouldn&amp;#8217;t be asking &amp;#8220;who is the audience.&amp;#8221; I would just say &amp;#8220;Ok, the audience is here. Now show me.&amp;#8221;&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=2OZZIfZNqV8:gLKB-FmApFQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=2OZZIfZNqV8:gLKB-FmApFQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=2OZZIfZNqV8:gLKB-FmApFQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=2OZZIfZNqV8:gLKB-FmApFQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/2OZZIfZNqV8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/social-media-marketing-this-is-your-chance-215/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/social-media-marketing-this-is-your-chance-215/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/social-media-marketing-this-is-your-chance-215/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[JavaScript: Private Static Members, Part 1]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/unxudqfSCW4/" />
		<id>http://coffeeonthekeyboard.com/?p=208</id>
		<updated>2009-06-18T17:23:54Z</updated>
		<published>2009-04-28T14:47:54Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="Code" /><category scheme="http://coffeeonthekeyboard.com" term="javascript" /><category scheme="http://coffeeonthekeyboard.com" term="oop" /><category scheme="http://coffeeonthekeyboard.com" term="programming" /><category scheme="http://coffeeonthekeyboard.com" term="tutorial" />		<summary type="html"><![CDATA[A little while ago I talked about creating private variables and methods in JavaScript. This works, but is not necessarily efficient: each instance of the class creates new copies of the members. While that may be exactly what you want for instance variables (think of partNum in the old examples) it is not always ideal.
The [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/javascript-private-static-members-part-1-208/">&lt;p&gt;&lt;a href="http://coffeeonthekeyboard.com/private-variables-in-javascript-177/" title="A little while ago"&gt;A little while ago&lt;/a&gt; I talked about creating private variables and methods in JavaScript. This works, but is not necessarily efficient: each instance of the class creates new copies of the members. While that may be exactly what you want for instance variables (think of &lt;code&gt;partNum&lt;/code&gt; in the old examples) it is not always ideal.&lt;/p&gt;
&lt;p&gt;The complexity jumps significantly, though. So I&amp;#8217;m dividing this half into two parts.&lt;/p&gt;
&lt;p&gt;To get started, we need to forget about all this Object-Oriented Programming for a minute and look at some of the neat &lt;a href="http://coffeeonthekeyboard.com/firefox-open-in-blank-tab-197/" title="tricks"&gt;tricks&lt;/a&gt; you can do with functions in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;a href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/" title="Part 2"&gt;Part 2&lt;/a&gt; is now available.&lt;span id="more-208"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;First, let&amp;#8217;s take a look at a few ways to define a function in JavaScript:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; oneFunction &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// function body goes here&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; anotherFunction = &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="co1"&gt;// function body goes here&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;;&lt;/div&gt;
&lt;p&gt;The first example, &lt;code&gt;oneFunction&lt;/code&gt; should be familiar to programmers from most languages. The second one is completely equivalent, but works slightly differently. In this case, the right-hand side, a function, is being assigned to the left-hand side, the var &lt;code&gt;anotherFunction&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Remember that in JavaScript, functions are first-class objects, just like everything else, so can be declared with the &lt;code&gt;var&lt;/code&gt; keyword. They can also be passed to other functions as arguments, or returned from functions.&lt;/p&gt;
&lt;p&gt;Now let&amp;#8217;s take a brief look at parentheses. What do parentheses really do? Essentially, they evaluate and return whatever expression is inside them. For example:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; five = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="nu0"&gt;5&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="co1"&gt;// the expression is &amp;quot;5&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; nine = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="nu0"&gt;2&lt;/span&gt; * &lt;span class="nu0"&gt;4&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; + &lt;span class="nu0"&gt;1&lt;/span&gt;;&lt;br /&gt;
&lt;span class="co1"&gt;// &amp;quot;2 * 4&amp;quot; is evaluated and returned as &amp;quot;8&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; nottrue = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;true&lt;/span&gt; || &lt;span class="kw2"&gt;false&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &amp;amp;amp;&amp;amp;amp; &lt;span class="kw2"&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class="co1"&gt;// &amp;quot;true || false&amp;quot; evalutes to &amp;quot;true&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; thirty = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="nu0"&gt;5&lt;/span&gt;*&lt;span class="nu0"&gt;5&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="nu0"&gt;-10&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;*&lt;span class="nu0"&gt;2&lt;/span&gt;;&lt;br /&gt;
&lt;span class="co1"&gt;// &amp;quot;5*5&amp;quot; is evaluated, then returned as 25 to 25-10,&lt;/span&gt;&lt;br /&gt;
&lt;span class="co1"&gt;// which evaluates to 15, which is returned and doubled&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;So parentheses are slightly more powerful than the simple grouping operation we associate with them. Sometimes we see examples like this, which may be more illustrative:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; checkName &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw3"&gt;name&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw3"&gt;name&lt;/span&gt;==&lt;span class="st0"&gt;&amp;#8216;admin&amp;#8217;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;So what happens if we combine parentheses&amp;#8217; ability to evaluate and return code with our ability to define functions as an expression?&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; aFunc = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt; &lt;span class="coMULTI"&gt;/*&amp;#8230;*/&lt;/span&gt; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;p&gt;Of course, this is just the same as &lt;code&gt;anotherFunction&lt;/code&gt; above, but you can see that the right-hand side &amp;#8220;returns&amp;#8221; a function. Let&amp;#8217;s do something a little different now:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw3"&gt;name&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;quot;Hello, &amp;quot;&lt;/span&gt;+&lt;span class="kw3"&gt;name&lt;/span&gt;+&lt;span class="st0"&gt;&amp;quot;!&amp;quot;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;quot;World&amp;quot;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;p&gt;What&amp;#8217;s going on here? The first set of parentheses [&lt;code&gt;(function ... )&lt;/code&gt;] evaluate and return the code inside, creating a function. The last set [&lt;code&gt;("World")&lt;/code&gt;] are then &lt;em&gt;calling&lt;/em&gt; the function created by the first set. Immediately.&lt;/p&gt;
&lt;p&gt;This is a powerful technique, but has certain limits. The interior function is executed immediately on creation, which means the &lt;abbr title="Document Object Model"&gt;DOM&lt;/abbr&gt; will probably not be loaded yet. Once the function is executed, it is lost. Trying to save it in the left-hand side of an equation will only save the &lt;em&gt;return value&lt;/em&gt; of the function, not the function itself. For example:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; aFunc = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="st0"&gt;&amp;quot;I&amp;#8217;m not a function!&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;aFunc&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// Alerts &amp;quot;I&amp;#8217;m not a function!&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;But, remember what I said about functions as first-class objects? It means we can use one function as a return value from another function:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; bFunc = &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt; &lt;span class="co1"&gt;// 1&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt; &lt;span class="co1"&gt;// 2&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="kw3"&gt;alert&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;quot;Hello, World!&amp;quot;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;; &lt;span class="co1"&gt;// 3&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;The outer function (1) is executed immediately (3), and the var &lt;code&gt;bFunc&lt;/code&gt; stores its return value, which is the inner function (2). So now, &lt;code&gt;bFunc&lt;/code&gt; is a function, and calling &lt;code&gt;bFunc()&lt;/code&gt; will alert &amp;#8220;Hello, World!&amp;#8221;.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;ll stop for now. If this technique is new to you, play with it for a while. If not, just hang tight and I&amp;#8217;ll get to &lt;a href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/" title="Part 2"&gt;Part 2&lt;/a&gt; soon enough.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=unxudqfSCW4:6P63D_HUY-Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=unxudqfSCW4:6P63D_HUY-Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=unxudqfSCW4:6P63D_HUY-Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=unxudqfSCW4:6P63D_HUY-Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/unxudqfSCW4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-1-208/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/javascript-private-static-members-part-1-208/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/javascript-private-static-members-part-1-208/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[Communities within Communities]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/W1g4FFbMcNg/" />
		<id>http://coffeeonthekeyboard.com/?p=204</id>
		<updated>2009-04-24T16:38:39Z</updated>
		<published>2009-04-24T16:38:39Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Social Media" /><category scheme="http://coffeeonthekeyboard.com" term="social messaging" /><category scheme="http://coffeeonthekeyboard.com" term="Social Networking" /><category scheme="http://coffeeonthekeyboard.com" term="twitter" />		<summary type="html"><![CDATA[There is an op-ed floating around Twitter today: As a social network, Twitter is a dud. Is it ironic that an article deriding Twitter is being spread on Twitter? Irony is so ill-defined.
Twitter is not for everyone, and I respect that, but the author, Alex Groves, seems to be basing his entire point of view [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/communities-within-communities-204/">&lt;p&gt;There is an op-ed floating around Twitter today: &lt;a href="http://www.mcall.com/news/opinion/anotherview/all-point.6868702apr24,0,6909055.story"&gt;As a social network, Twitter is a dud&lt;/a&gt;. Is it ironic that an article deriding Twitter is being spread on Twitter? Irony is so ill-defined.&lt;/p&gt;
&lt;p&gt;Twitter is not for everyone, and I respect that, but the author, Alex Groves, seems to be basing his entire point of view on Ashton Kutcher. Alex claims (and this may well be true; I don&amp;#8217;t know since I&amp;#8217;m never on Facebook) that &amp;#8220;[t]he only problem with all this twittering by celebrities and politicians is that they are on Facebook much more often.&amp;#8221;&lt;/p&gt;
&lt;p&gt;Based on this, Alex argues that Twitter is an &amp;#8220;unnecessary&amp;#8221; alternative to Facebook walls and warns that &amp;#8220;[b]y spending more time on social networks and the Internet than we need to, we enable ourselves to become reclusive, sheltered from family and friends.&amp;#8221;&lt;/p&gt;
&lt;p&gt;What Alex is ignoring is that most people are not (just) following celebrities. If we look at the number of &amp;#8220;following&amp;#8221; relationships—even relatively inactive people often follow 30 or 40 others—the 1 million &amp;#8220;follows&amp;#8221; of Mr. Kutcher seems much, much less impressive.&lt;/p&gt;
&lt;p&gt;What occurs to me, the more I see Twitter on newspaper websites and on the Today show, is that there are multiple communities within a larger community like Twitter.&lt;/p&gt;
&lt;p&gt;On the very smallest scale, you may have a &amp;#8220;community&amp;#8221; of family and friends that are mostly following each other. You may have a &lt;a href="http://www.tweetdeck.com/beta/"&gt;TweetDeck&lt;/a&gt; group set up for them. That kind of mutual relationship leads to what Clive Thompson of the Times called &amp;#8220;&lt;a href="http://www.nytimes.com/2008/09/07/magazine/07awareness-t.html?_r=1"&gt;ambient awareness&lt;/a&gt;&amp;#8220;. I would encourage Alex to read Mr. Thompson&amp;#8217;s article, it might answer his question: &amp;#8220;How does one know if his friends are OK?&amp;#8221;&lt;/p&gt;
&lt;p&gt;Now, Alex is absolutely right that spending too much time on the internet can take time away from other meaningful activities, like &amp;#8220;enjoy[ing] a crisp, clean-smelling spring morning.&amp;#8221; (With my allergies, I don&amp;#8217;t think I have ever &amp;#8220;enjoy[ed]&amp;#8221; that.)&lt;/p&gt;
&lt;p&gt;But the same could be said about almost any aspect of life. Too much time at work causes you to lose time with the family. Too much time away from work can make you lose your job. Too much time using computers can give you carpal tunnel.&lt;/p&gt;
&lt;p&gt;On the large end of communities, I think you could classify several, such as &amp;#8220;people interested in social networking,&amp;#8221; &amp;#8220;people interested in marketing,&amp;#8221; &amp;#8220;people interested in programming&amp;#8221; (I&amp;#8217;m in all three of these communities) &amp;#8220;people interested in celebrities,&amp;#8221; &amp;#8220;people interested in news,&amp;#8221; &amp;#8220;people interested in &amp;lt;insert your special topic here&amp;gt;.&amp;#8221;&lt;/p&gt;
&lt;p&gt;I would argue that these communities reflect real-life relationships the same way the small communities do. A person who is more likely to read Us Weekly is probably more likely to follow more celebrities. A person who enjoys Britney Spears&amp;#8217; music is more likely to follow her. Just as I am more likely to make a joke about the word &amp;#8220;const&amp;#8221; on a construction sign, I am more likely to follow &lt;a href="http://twitter.com/jeresig"&gt;John Resig&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Alex asks, &amp;#8220;[w]ith all the good we can do online, including disseminating information and spreading knowledge, why do we become obsessed with Britney Spears tweeting about playing with the boys on tour?&amp;#8221;&lt;/p&gt;
&lt;p&gt;I contend that the people Alex is really criticizing (surely many of the &lt;a href="http://www.techcrunch.com/2009/04/24/twitter-eats-world-global-visitors-shoot-up-to-19-million/"&gt;newest users&lt;/a&gt;) are the same people snapping up People at the checkout lane and watching TMZ in the mornings. Furthermore, he fails to recognize the rather large community of users that uses Twitter to share information and resources, follow the lives of people who may be emotionally, but not physically close, or generate other types of value.&lt;/p&gt;
&lt;p&gt;The complaints he levies could—arguably &lt;em&gt;should—&lt;/em&gt;be equally directed at Facebook, MySpace, several websites, magazines and TV shows. Alex is confusing &amp;#8220;Twitter&amp;#8221; with a culture of &amp;#8220;celebrity worship.&amp;#8221;&lt;/p&gt;
&lt;p&gt;I argue that the people creating value off Twitter (and Facebook) are the same people creating it &lt;em&gt;on&lt;/em&gt; Twitter. If all you follow on Twitter are celebrities, you obviously aren&amp;#8217;t contributing much to that community&amp;#8217;s conversation. On the other hand, if your community is broad, and includes peers, friends, family, then you have a unique opportunity to both benefit from, and provide benefit to, that community.&lt;/p&gt;
&lt;p&gt;Fortunately, the way Twitter works, I don&amp;#8217;t need to follow those celebrities. And neither do you, Alex.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=W1g4FFbMcNg:OywfWC-J-90:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=W1g4FFbMcNg:OywfWC-J-90:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=W1g4FFbMcNg:OywfWC-J-90:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=W1g4FFbMcNg:OywfWC-J-90:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/W1g4FFbMcNg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/communities-within-communities-204/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/communities-within-communities-204/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/communities-within-communities-204/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James</name>
						<uri>http://jamessocol.com/</uri>
					</author>
		<title type="html"><![CDATA[Firefox: Open in Blank Tab]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/coffeeonthekeyboard/~3/Z6QFkyQU9RM/" />
		<id>http://coffeeonthekeyboard.com/?p=197</id>
		<updated>2009-04-22T18:17:49Z</updated>
		<published>2009-04-22T14:47:41Z</published>
		<category scheme="http://coffeeonthekeyboard.com" term="Articles" /><category scheme="http://coffeeonthekeyboard.com" term="firefox" /><category scheme="http://coffeeonthekeyboard.com" term="javascript" /><category scheme="http://coffeeonthekeyboard.com" term="links" /><category scheme="http://coffeeonthekeyboard.com" term="tricks" />		<summary type="html"><![CDATA[If you don&#8217;t use Firefox 3, go get it. Then finish this article. (Safari and Opera users are excused, but there&#8217;s no promise this will work for them.)
One of my (few) gripes with Firefox is that bookmarks on the toolbar have no &#8220;open in blank tab&#8221; option. They have an &#8220;open in sidebar&#8221; option, but [...]]]></summary>
		<content type="html" xml:base="http://coffeeonthekeyboard.com/firefox-open-in-blank-tab-197/">&lt;p&gt;If you don&amp;#8217;t use Firefox 3, &lt;a href="http://www.mozilla.com/en-US/"&gt;go get it&lt;/a&gt;. Then finish this article. (Safari and Opera users are excused, but there&amp;#8217;s no promise this will work for them.)&lt;/p&gt;
&lt;p&gt;One of my (few) gripes with Firefox is that bookmarks on the toolbar have no &amp;#8220;open in blank tab&amp;#8221; option. They have an &amp;#8220;open in sidebar&amp;#8221; option, but those uses are rare and esoteric at best. Personally, I never use the sidebar.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Open in blank tab&amp;#8221; should basically do this: if there is a blank tab, use it; if not, create a new tab. Frankly, it could just open in a new tab regardless, but it seems like such an easy thing to add.&lt;/p&gt;
&lt;p&gt;But? It can&amp;#8217;t be done directly in Firefox. Hence, I present this small script:&lt;/p&gt;
&lt;div class="dean_ch" style="white-space: wrap;"&gt;javascript:&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="kw2"&gt;function&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; u=&lt;span class="st0"&gt;&amp;#8216;http://mail.google.com/mail&amp;#8217;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &lt;span class="kw1"&gt;if&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;window.&lt;span class="me1"&gt;location&lt;/span&gt;==&lt;span class="st0"&gt;&amp;#8216;about:blank&amp;#8217;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; window.&lt;span class="me1"&gt;location&lt;/span&gt;=u;&lt;br /&gt;
&amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;span class="kw1"&gt;else&lt;/span&gt;&lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; window.&lt;span class="kw3"&gt;open&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;u,&lt;span class="st0"&gt;&amp;#8221;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s it. Try dragging this link to &lt;a href="javascript:(function(){var%20u='http://mail.google.com/mail';%20if(window.location=='about:blank'){window.location=u;}else{window.open(u,'');}})();"&gt;GMail&lt;/a&gt; to your bookmark toolbar. Then click the link on your toolbar. Now, open a new tab, and click the link again.&lt;/p&gt;
&lt;p&gt;This isn&amp;#8217;t exactly what I asked for. It has no way of knowing if any blank tab exists, only if the current tab is blank. And, of course, it lacks the nice favicon support.&lt;/p&gt;
&lt;p&gt;But it does the job. If you change the variable &lt;code&gt;u&lt;/code&gt; to something other than &amp;#8216;http://mail.google.com/mail&amp;#8217;, you can make the link open any other page.&lt;/p&gt;
&lt;p&gt;I love anonymous functions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; If you want a bookmark for something besides GMail, you can &lt;a href="javascript:(function(){var u=prompt('Enter the URL to open in a blank tab.','http://');prompt('Copy the text below into a new bookmark.',&amp;quot;javascript:(function(){var u='&amp;quot;+u+&amp;quot;';if(window.location=='about:blank'){window.location=u;}else{window.open(u,'');}})();&amp;quot;);})();"&gt;create your own&lt;/a&gt;. Or you can drag &lt;em&gt;this&lt;/em&gt; link to your toolbar, to make new ones whenever you want: &lt;a href="javascript:(function(){var u=prompt('Enter the URL to open in a blank tab.',window.location);prompt('Copy the text below into a new bookmark.',&amp;quot;javascript:(function(){var u='&amp;quot;+u+&amp;quot;';if(window.location=='about:blank'){window.location=u;}else{window.open(u,'');}})();&amp;quot;);})();"&gt;Open in Blank Tab&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt; Oops, fixed the &amp;#8220;create your own&amp;#8221; link. Tested it, then accidentally pasted in the results, instead of the actual script.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=Z6QFkyQU9RM:kCldvIkFSZg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=Z6QFkyQU9RM:kCldvIkFSZg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?a=Z6QFkyQU9RM:kCldvIkFSZg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/coffeeonthekeyboard?i=Z6QFkyQU9RM:kCldvIkFSZg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/coffeeonthekeyboard/~4/Z6QFkyQU9RM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://coffeeonthekeyboard.com/firefox-open-in-blank-tab-197/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://coffeeonthekeyboard.com/firefox-open-in-blank-tab-197/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://coffeeonthekeyboard.com/firefox-open-in-blank-tab-197/</feedburner:origLink></entry>
	</feed>
