<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-542398624287876588</id><updated>2012-03-06T16:02:32.161Z</updated><category term='this'/><category term='philosophical'/><category term='operator'/><category term='tools'/><category term='javascript'/><category term='mysql'/><category term='debugging'/><category term='pitfall'/><category term='arrays'/><category term='scope'/><category term='Prototype'/><category term='method'/><category term='functions'/><category term='engineering google-code wrong defaults'/><category term='gae'/><category term='tip'/><category term='non-coding'/><category term='t-sql'/><category term='patents'/><category term='var'/><category term='regular-expressions'/><category term='meta'/><category term='jquery'/><category term='off-topic'/><category term='css'/><category term='welcome'/><category term='irritations'/><category term='sql'/><category term='plugin'/><category term='hacks'/><category term='reference'/><category term='html'/><category term='design'/><category term='FogBugz'/><category term='myths'/><category term='closures'/><category term='VS.Net'/><category term='google'/><title type='text'>Nifty Snippets</title><subtitle type='html'>Nifty Snippets&lt;sup&gt;TM&lt;/sup&gt; of code, techniques, and information focussing on Ajax, web scripting, and engineering.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>62</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6518566781808296475</id><published>2012-03-06T15:56:00.003Z</published><updated>2012-03-06T16:02:32.270Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='FogBugz'/><category scheme='http://www.blogger.com/atom/ns#' term='hacks'/><title type='text'>Adding language choice to FogBugz's code snippets</title><summary type='text'>Surprisingly, the "code snippet" widget used by the FogBugz wiki feature doesn't support telling the pretty-printer (they're using Google's google-code-prettify script) what language the text is in. Since the script can't always tell what language the code is in, this is a problem. And apparently, I'm the first one to ask about this. Wow.The answer is to write a BugMonkey script and install it in</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6518566781808296475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6518566781808296475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6518566781808296475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6518566781808296475'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2012/03/adding-language-choice-to-fogbugzs-code.html' title='Adding language choice to FogBugz&apos;s code snippets'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1948870479059994927</id><published>2012-03-01T15:14:00.003Z</published><updated>2012-03-01T15:32:33.028Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='regular-expressions'/><title type='text'>Match everything...except!</title><summary type='text'>Micro-post:I was truly shocked to find today that in JavaScript regular expressions, . (the decimal point) doesn't do what I thought it did. I thought . meant "match any character." You too? Yeah. But it doesn't. Specifically, . doesn't match line terminators (so, \r, \n, \u2028, and \u2029). From Section 15.10.2.8:The production Atom :: . evaluates as follows:Let A be the set of all characters </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1948870479059994927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1948870479059994927' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1948870479059994927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1948870479059994927'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2012/03/match-everythingexcept.html' title='Match everything...except!'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6507587824570594878</id><published>2012-02-28T11:00:00.004Z</published><updated>2012-02-28T11:09:48.627Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Creating a function with a true name defined at runtime</title><summary type='text'>Okay, I'll admit it, this is an obscure one:I came up with a use case where I wanted to create a function that had a real name (e.g., shows in debuggers and such) that was determined at runtime. And as far as I can tell, the only way to do that is to use eval."eval!??!?!" I hear you gasp.Yes, eval. eval is evil when you can avoid it (which is almost always), but with strings you're in total </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6507587824570594878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6507587824570594878' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6507587824570594878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6507587824570594878'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2012/02/creating-function-with-true-name.html' title='Creating a function with a true name defined at runtime'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-7140954035981773351</id><published>2012-02-26T15:44:00.003Z</published><updated>2012-02-26T15:58:59.108Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='engineering google-code wrong defaults'/><title type='text'>Google Code - Error retrieving directory contents</title><summary type='text'>I dropped by one of my Google Code projects, a trivial little jQuery placeholder functionality shim called place5, and was quite surprised to see, on the Source tab, the message "Error retrieving directory contents". Now, I have backups (and you do too, of anything you host externally, right?), so I wasn't panicked or anything, but I was still...jarred.Some searching around revealed that people </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/7140954035981773351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=7140954035981773351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7140954035981773351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7140954035981773351'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2012/02/google-code-error-retrieving-directory.html' title='Google Code - Error retrieving directory contents'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1826388663346407441</id><published>2012-02-14T17:11:00.002Z</published><updated>2012-02-14T17:14:15.916Z</updated><title type='text'>Getting rid of "What's Hot"</title><summary type='text'>Google have finally made it possible to get the "What's Hot" rubbish out of your main Google+ stream. Here's how:Go to Google+.Click "What's Hot" on the left-hand side.At the top of the page, there's a subtle little slider (basically an O on a line). Move it all the way to the left.(If you don't see a slider at the top of your What's Hot page, just wait a day or two for the rollout to come to a </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1826388663346407441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1826388663346407441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1826388663346407441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1826388663346407441'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2012/02/getting-rid-of-whats-hot.html' title='Getting rid of &quot;What&apos;s Hot&quot;'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-3991689834333506996</id><published>2012-02-10T17:56:00.003Z</published><updated>2012-02-10T18:10:35.748Z</updated><title type='text'>`forEach` and runtime cost</title><summary type='text'>Just a tiny one today, mostly to write this down somewhere:As you all know, ECMAScript5 adds forEach to arrays, where you supply a function that gets called for each element in the array. There are lots of benefits to this, not least variable scoping on the index and value variables and a bit less typing, but don't all of those function calls add up to a significant runtime cost?No, they don't.I </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/3991689834333506996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=3991689834333506996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3991689834333506996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3991689834333506996'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2012/02/foreach-and-runtime-cost.html' title='`forEach` and runtime cost'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4791160294079911995</id><published>2011-11-30T12:45:00.005Z</published><updated>2011-11-30T13:08:01.946Z</updated><title type='text'>The story on return false</title><summary type='text'>In JavaScript event handlers, you'll frequently see return false; at the end. Why? What does it do? The answer is: It depends. Before we get into the details, there are basically two things it could be doing:Preventing the default action of the event, such as when you click a link and the browser follows it.Stopping propagation of the event to ancestor elements.So which does return false do? Just</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4791160294079911995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4791160294079911995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4791160294079911995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4791160294079911995'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/11/story-on-return-false.html' title='The story on return false'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-7880846903556041741</id><published>2011-10-07T09:42:00.003+01:00</published><updated>2011-10-07T10:00:16.653+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='gae'/><title type='text'>Finally!</title><summary type='text'>Google announces an honest-to-goodness relational DB for App Engine: Google Cloud SQL. And it's the nice, familiar MySQL engine with virtually full support and very few limitations. Notably missing from that FAQ is anything about limits on how long a statement can take to complete (I've asked the question), but other than that...</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/7880846903556041741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=7880846903556041741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7880846903556041741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7880846903556041741'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/10/finally.html' title='Finally!'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2558361546177584380</id><published>2011-08-26T14:04:00.003+01:00</published><updated>2011-08-26T14:09:37.678+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='patents'/><title type='text'>Potentially Good News on Software Patents</title><summary type='text'>There's some potentially good news on software patents. The Federal Circuit appeals court has rejected a patent claim on the basis that it's just an "abstract idea," a door that was very slightly opened in a recent very narrowly-drawn Supreme Court patent decision. Might reason ultimately prevail over avarice and bullying...? Paraphrasing something a good friend of mine said to me once, I'm </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2558361546177584380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2558361546177584380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2558361546177584380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2558361546177584380'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/08/potentially-good-news-on-software.html' title='Potentially Good News on Software Patents'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5887233502387814700</id><published>2011-08-23T10:21:00.003+01:00</published><updated>2011-08-23T10:28:20.530+01:00</updated><title type='text'>Nifty Snippets bite-sized morsels</title><summary type='text'>Sometimes the pressure for a proper "article" is too much and I end up not posting something here that I run across that I think is interesting. I thought "If only there were a service tailored to quick thoughts and links..." and of course, immediately thought of Tumblr (yes, and Twitter, but I was looking for something in between blogging and tweeting). So may I present: The Nifty Snippets </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5887233502387814700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5887233502387814700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5887233502387814700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5887233502387814700'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/08/nifty-snippets-bite-sized-morsels.html' title='Nifty Snippets bite-sized morsels'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/03619792122821936638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6606073201668909602</id><published>2011-06-16T04:37:00.003+01:00</published><updated>2011-06-16T04:47:22.938+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='tip'/><title type='text'>Copying table structure in SQL Server</title><summary type='text'>Why didn't I know this? For so many years I've bemoaned the fact that SQL Server doesn't have MySQL's CREATE TABLE LIKE statement:CREATE TABLE NewTable LIKE ExistingTableUm, er, except it does:SELECT TOP 0 INTO NewTable FROM ExistingTableThe INTO clause of SELECT..."...creates a new table in the default filegroup and inserts the resulting rows from the query into it." (MSDN link)And of course, if</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6606073201668909602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6606073201668909602' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6606073201668909602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6606073201668909602'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/06/copying-table-structure-in-sql-server.html' title='Copying table structure in SQL Server'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6081318189608134854</id><published>2011-06-12T10:38:00.006+01:00</published><updated>2011-06-12T11:02:33.531+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='irritations'/><category scheme='http://www.blogger.com/atom/ns#' term='non-coding'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Apps migration and multiple accounts</title><summary type='text'>Non-coding post today. If you use Google Apps for your Domain, you've either been transitioned to the new "full" infrastructure or you soon will be. If like a lot of people you have this crazy idea that your personal and professional lives should be separate, and so you have separate accounts for personal and private stuff, you'll run into the problem that your Google Apps stuff and your Google </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6081318189608134854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6081318189608134854' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6081318189608134854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6081318189608134854'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/06/google-apps-migration-and-multiple.html' title='Google Apps migration and multiple accounts'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5174777983255204338</id><published>2011-06-08T11:33:00.006+01:00</published><updated>2011-06-12T11:01:23.207+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Release: place5 placeholder emulator plugin (alpha)</title><summary type='text'>Just briefly, folks, I'm writing to announcing the alpha release of my place5 jQuery plugin. It's just a dead-simple plugin that emulates HTML5 placeholder attribute behavior on browsers that don't support it natively. On browsers that do, it stays out of the way (unless you tell it to take over), but it quietly does the job for you on browsers that don't do it themselves. Check it out! This is </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5174777983255204338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5174777983255204338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5174777983255204338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5174777983255204338'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/06/release-place5-placeholder-emulator.html' title='Release: place5 placeholder emulator plugin (alpha)'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1004322162791617818</id><published>2011-05-22T13:28:00.007+01:00</published><updated>2011-06-12T10:58:41.294+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='arrays'/><title type='text'>Appending to an array</title><summary type='text'>JavaScript's Array#concat function is handy and cool, but it creates a copy of both arrays. That is, given array a and array b, a.concat(b) will create a third array c with the contents of both of them, leaving a and b intact. Now, sometimes that's what you want, but other times you just want to append b to a without creating a copy of a.While JavaScript doesn't have a dedicated append function, </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1004322162791617818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1004322162791617818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1004322162791617818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1004322162791617818'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/05/appending-to-array.html' title='Appending to an array'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1919942480691584680</id><published>2011-05-11T03:29:00.005+01:00</published><updated>2011-06-12T11:01:01.785+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery 1.6.1 softens `attr` woes</title><summary type='text'>jQuery 1.6's change to the attr function, and introduction of the prop function, raised quite a bit of confusion (and awareness) about properties and attributes. It was quite a breaking change, affecting a fair bit of code, and so jQuery 1.6.1 changes attr again to make it more backward-compatible. See the jQuery 1.6.1 blog post for details. According to the jQuery team, as of 1.6.1, most older </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1919942480691584680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1919942480691584680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1919942480691584680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1919942480691584680'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/05/jquery-161-softens-attr-woes.html' title='jQuery 1.6.1 softens `attr` woes'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4614620895664386801</id><published>2011-05-04T06:24:00.008+01:00</published><updated>2011-06-12T11:01:31.321+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Big compatibility break in jQuery 1.6</title><summary type='text'>jQuery 1.6 is out, and unusually for jQuery, there's a pretty big API compatibility break with regard to the attr function. Details in the release notes, but basically, attr really is just for attributes now, whereas before it sort of conflated attributes and properties. There's a new prop function for interacting with properties.Update 2011/05/11: jQuery 1.6.1 changes attr again to make it more </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4614620895664386801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4614620895664386801' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4614620895664386801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4614620895664386801'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/05/big-compatibility-break-in-jquery-16.html' title='Big compatibility break in jQuery 1.6'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4229894684739682025</id><published>2011-04-26T01:11:00.004+01:00</published><updated>2011-06-12T10:49:47.249+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='non-coding'/><category scheme='http://www.blogger.com/atom/ns#' term='philosophical'/><title type='text'>A brief, incomplete definition of 'an engineer'</title><summary type='text'>Most of us, much of the time, react to "You're wrong" with "No I'm not! And you can't tell me otherwise!" An engineer's response is "How? Show me."</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4229894684739682025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4229894684739682025' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4229894684739682025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4229894684739682025'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/04/brief-incomplete-definition-of-engineer.html' title='A brief, incomplete definition of &apos;an engineer&apos;'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-7457045324176228223</id><published>2011-04-23T11:45:00.018+01:00</published><updated>2011-06-12T10:50:12.029+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='non-coding'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.Net'/><title type='text'>Thinking outside the box with the ASP.Net Development Server</title><summary type='text'>A well-known limitation of the ASP.Net Development Server is that it will only bind to the local interface of the development machine, never the LAN interface, and so you can't bring up pages served from the development server from anywhere but on the box itself via the localhost name or 127.0.0.1 address. And fair enough, it's meant to be a debugger aid, not a web server. But there are </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/7457045324176228223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=7457045324176228223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7457045324176228223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7457045324176228223'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/04/thinking-outside-box-with-aspnet.html' title='Thinking outside the box with the ASP.Net Development Server'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-8070909003177111568</id><published>2011-03-29T12:57:00.003+01:00</published><updated>2011-06-12T10:51:25.489+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='off-topic'/><title type='text'>Gorgeous</title><summary type='text'>Completely off-topic, but gorgeous.</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/8070909003177111568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=8070909003177111568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8070909003177111568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8070909003177111568'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/03/gorgeous.html' title='Gorgeous'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-8913742537412176722</id><published>2011-03-18T13:58:00.009Z</published><updated>2011-06-12T10:58:56.287+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='debugging'/><title type='text'>No Excuse</title><summary type='text'>I'm active in a couple of places where people go for help with, amongst other things, JavaScript code running in web browsers. Routinely, you'll get questions like this one where the person asking the question is having trouble visualizing what's happening on the client side, and is stabbing in the dark with alert or console.log to try to figure out what's going on. It's like the old days of </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/8913742537412176722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=8913742537412176722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8913742537412176722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8913742537412176722'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/03/no-excuse.html' title='No Excuse'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-471137105436852353</id><published>2011-01-30T16:44:00.006Z</published><updated>2011-06-12T10:59:02.590+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Skipping the protocol</title><summary type='text'>I just found out about this incredibly useful trick for loading absolute resources with either http: or https: depending on the protocol with which your page was loaded (to avoid those "mixed content" complaints from browsers).Amazingly, you can just leave the scheme (protocol) part off the URL entirely. So for instance, if you're loading jQuery from the Google CDN with this path:&lt;script src='</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/471137105436852353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=471137105436852353' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/471137105436852353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/471137105436852353'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/01/skipping-protocol.html' title='Skipping the protocol'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-8467355891487052513</id><published>2011-01-23T16:30:00.007Z</published><updated>2011-06-12T10:59:14.216+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='myths'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='arrays'/><title type='text'>A myth of arrays</title><summary type='text'>When is an array not an array?When it's a JavaScript array.JavaScript objects are basically just key=value maps, and JavaScript arrays are nothing more than objects that have:special handling for keys that are numeric stringsa special length propertyand some functions they inherit from Array.prototypeThat's it. Although we conventionally write array "indexes" as numbers, like all property names </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/8467355891487052513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=8467355891487052513' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8467355891487052513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8467355891487052513'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2011/01/myth-of-arrays.html' title='A myth of arrays'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1703233134431052016</id><published>2010-12-23T14:19:00.008Z</published><updated>2011-06-12T10:59:20.678+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Say what?</title><summary type='text'>Something that seems to come up a lot in JavaScript work is the need to figure out what kind of thing you're dealing with — is it a string? a number? a Date? And JavaScript has various features to help you do that, but there are some "gotchas" to watch out for. In this post I'll talk about various strategies for figuring out what things are.Basically, you have four tools you can use, each of </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1703233134431052016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1703233134431052016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1703233134431052016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1703233134431052016'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/say-what.html' title='Say what?'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2717666992974960876</id><published>2010-12-14T12:00:00.003Z</published><updated>2011-06-12T10:54:05.754+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='off-topic'/><title type='text'>Another off-topic gob-smacker</title><summary type='text'>Another near-Neil-Armstrong moment (like this one) is upon us: Voyager 1 has begun transiting the heliopause, the boundary between our solar system and interstellar space. All being well, Voyager will actually go interstellar within the next five years. Yes, five years — it's a big boundary, and not an artificial one: it's where the solar wind's strength is no longer great enough to push back the</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2717666992974960876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2717666992974960876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2717666992974960876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2717666992974960876'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/12/another-off-topic-gob-smacker.html' title='Another off-topic gob-smacker'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1658736198677698853</id><published>2010-12-08T12:01:00.006Z</published><updated>2011-06-12T10:59:26.949+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='reference'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Ever wondered what browsers support &lt;insert feature here&gt;?</title><summary type='text'>There's a site for that: caniuse.com.So, for instance, what browsers support the File API? These ones: http://caniuse.com/#search=file api.</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1658736198677698853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1658736198677698853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1658736198677698853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1658736198677698853'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/12/ever-wondered-what-browsers-support.html' title='Ever wondered what browsers support &amp;lt;&lt;em&gt;insert feature here&lt;/em&gt;&amp;gt;?'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2588236936216126519</id><published>2010-12-08T11:01:00.004Z</published><updated>2010-12-08T11:15:08.288Z</updated><title type='text'>V8 Raises the Bar Again</title><summary type='text'>Google's V8 JavaScript engine is well-known for being freaky fast, but far from resting on their laurels, the V8 team are taking things to the next level. Their latest enhancement, which they call Crankshaft, is basically HotSpot for JavaScript. They scale back the optimizations done by the main compilation step, thereby compiling scripts faster and reducing page load time, but then identify and </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2588236936216126519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2588236936216126519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2588236936216126519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2588236936216126519'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/12/v8-raises-bar-again.html' title='V8 Raises the Bar Again'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1429731729321042741</id><published>2010-11-18T13:20:00.005Z</published><updated>2010-11-18T13:29:08.565Z</updated><title type='text'>Dear Computer Product Manufacturers</title><summary type='text'>The place for "Compatible with" stickers is on the box, not on the product. I couldn't care less that my new monitor is "Compatible with Windows 7", and if I did care, I'd've been looking for that information before I bought it, making the sticker on the base marring what is an otherwise lovely bit of modern piano black design completely and utterly pointless. &lt;/rant&gt; Now, where's that bottle of </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1429731729321042741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1429731729321042741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1429731729321042741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1429731729321042741'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/11/dear-computer-product-manufacturers.html' title='Dear Computer Product Manufacturers'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5371970267670387058</id><published>2010-11-07T10:46:00.007Z</published><updated>2010-11-07T18:23:58.873Z</updated><title type='text'>Myths and realities of for..in</title><summary type='text'>Probably the second most enduring myth about JavaScript is that the for..in statement loops through the indexes of an array. It doesn't, and if you write code that assumes it does, then even if the code doesn't break in its nice cozy nest on your computer, it's likely to as soon as you expose it to the complexities of the outside world.In this article, I'll explain the myth, the reality of what </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5371970267670387058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5371970267670387058' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5371970267670387058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5371970267670387058'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/11/myths-and-realities-of-forin.html' title='Myths and realities of for..in'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-8858220696580961925</id><published>2010-10-08T17:05:00.003+01:00</published><updated>2010-10-08T17:29:45.978+01:00</updated><title type='text'>CSS and showing my age</title><summary type='text'>Okay. I can't be the only one. Surely some of you also have trouble remembering the order of the values in CSS shorthand properties, e.g.:margin: 10px 20px 30px 40px;I mean, I'm an engineering kind of guy. I'm used to coordinate systems like (top,left)-(bottom,right) or (x1,y1)-(x2,y2). CSS, however, uses neither. Instead, it's top right bottom left. I expect there's a good reason.So showing my </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/8858220696580961925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=8858220696580961925' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8858220696580961925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8858220696580961925'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/10/css-and-showing-my-age.html' title='CSS and showing my age'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2027258042652897806</id><published>2010-10-05T15:58:00.007+01:00</published><updated>2011-03-14T06:46:38.402Z</updated><title type='text'>IE6, the Undead Browser</title><summary type='text'>2011/03/14: See also Microsoft's new IE6 countdown site2010/11/18: Updated to also reference StatCounter's figures (for May 2010).There's a common refrain on sites where people ask for help getting things to work well cross-browser, when someone mentions needing to support IE6:IE6 is dead. Microsoft officially stopped supporting it. I don't see any reason you should.— comment from a StackOverflow</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2027258042652897806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2027258042652897806' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2027258042652897806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2027258042652897806'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/10/ie6-undead-browser.html' title='IE6, the Undead Browser'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4580183243251179674</id><published>2010-09-21T09:15:00.002+01:00</published><updated>2010-09-21T09:45:50.921+01:00</updated><title type='text'>A literal improvement</title><summary type='text'>JavaScript literals are getting better. Until recently, the grammar for object literals didn't explicitly allow a trailing comma, like this:var obj = {    foo: 42,    bar: 27, // &lt;== This is the problem};SpiderMonkey (Firefox), V8 (Chrome), and whatever Safari and Opera use don't care, but JScript (IE) prior to JScript 6 (IE8) throws a parsing exception on the comma and your script dies. (JScript</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4580183243251179674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4580183243251179674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4580183243251179674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4580183243251179674'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/literal-improvement.html' title='A literal improvement'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-3611804274202459581</id><published>2010-09-19T16:29:00.003+01:00</published><updated>2010-09-19T16:54:59.576+01:00</updated><title type='text'>Don't Default Destroy</title><summary type='text'>Here's a little tidbit for UI designers: Don't default to destroying things. You'd think that would have been obvious, no?No. VirtualBox is an excellent virtualization environment, one of the best in the world and possibly a contender for the top spot. But the default UI has a big UI fault.VirtualBox, like most good VM technologies, lets you take "snapshots" of VMs that you can then restore, </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/3611804274202459581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=3611804274202459581' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3611804274202459581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3611804274202459581'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/dont-default-destroy.html' title='Don&apos;t Default Destroy'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-7548460146769382740</id><published>2010-09-16T12:33:00.007+01:00</published><updated>2012-01-07T00:05:08.942Z</updated><title type='text'>Double-take</title><summary type='text'>There's an issue with Microsoft's JScript interpreter (the one used by IE, Windows Scripting Host, and others) that you see mentioned deep in discussions of other things. I thought it would be worth just briefly talking about on its own.Basically, if you use a named function expression in your JavaScript code, JScript will process it twice, creating two separate function objects, at two separate </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/7548460146769382740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=7548460146769382740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7548460146769382740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/7548460146769382740'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/double-take.html' title='Double-take'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4040802601842741616</id><published>2010-09-12T16:18:00.009+01:00</published><updated>2010-09-12T16:50:02.985+01:00</updated><title type='text'>Boot, Ubuntu, boot! Good dog!</title><summary type='text'>This isn't about writing software, but it's a snippet, so...I have a fresh new desktop based on the Intel DH57JG board on which I've happily installed Ubuntu 10.04 LTS desktop. Aside from a video mode detection issue, things are great, but I had an odd symptom: Ubuntu could successfully shut down and power off, but it would crash if I asked it to reboot. Just an annoyance, but surprisingly...</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4040802601842741616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4040802601842741616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4040802601842741616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4040802601842741616'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/reboot-ubuntu-reboot-good-dog.html' title='Boot, Ubuntu, boot! Good dog!'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4420998383775245243</id><published>2010-09-09T22:41:00.003+01:00</published><updated>2010-09-09T22:45:54.706+01:00</updated><title type='text'>Modern Youth</title><summary type='text'>My son has now unequivocally demanded his own proper computer.My son is not yet three years old.At this rate, by the time he's six he'll have a better StackOverflow rep than I have.</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4420998383775245243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4420998383775245243' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4420998383775245243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4420998383775245243'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/modern-youth.html' title='Modern Youth'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2012797186728531170</id><published>2010-09-05T14:54:00.003+01:00</published><updated>2010-09-05T15:29:30.550+01:00</updated><title type='text'>Beyond Either/Or</title><summary type='text'>So I was doing a massive file comparison operation (hundreds of thousands of files, &gt;100 GB of data) today on one of my Windows boxes and so naturally fired up the excellent WinMerge, my favorite — by a wide margin — Windows-based visual diff/merge tool. And it did something that is so smart, I just had to mention it.Usually when you ask software to do an operation on a set of files you identify </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2012797186728531170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2012797186728531170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2012797186728531170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2012797186728531170'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/overlapping.html' title='Beyond Either/Or'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5252591036247188399</id><published>2010-09-03T14:08:00.004+01:00</published><updated>2010-09-03T14:12:27.084+01:00</updated><title type='text'>Brilliant - A periodic table of elements</title><summary type='text'>Josh Duck has done a Periodic Table of the Elements for HTML5. Brilliant (and pretty). In the 20 or so years of HTML, surely someone has thought of this concept before — but if so, I'm certainly not aware of it. Props to Josh!</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5252591036247188399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5252591036247188399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5252591036247188399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5252591036247188399'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/09/brilliant.html' title='Brilliant - A periodic table of elements'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-8527277172501928808</id><published>2010-06-09T12:51:00.003+01:00</published><updated>2010-06-09T12:53:20.317+01:00</updated><title type='text'>What every programmer should know about sysadmin</title><summary type='text'>Link-post today: Do you write software that someone is going to have to deploy to servers and administer? Then read this question on ServerFault and its answers, most especially this answer. Then read them again.'Nuff said.</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/8527277172501928808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=8527277172501928808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8527277172501928808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/8527277172501928808'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/06/what-every-programmer-should-know-about.html' title='What every programmer should know about sysadmin'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6283175166582539685</id><published>2010-03-19T23:32:00.004Z</published><updated>2010-03-19T23:54:03.947Z</updated><title type='text'>Small is...useful</title><summary type='text'>Micro-post today:I'm an active member of a couple of places where people post questions and (hopefully) get answers to them. Time and time again I see questions like "I'm doing X, but it isn't working. Why not?" followed by 35-200 lines of code, of which the eponymous "X" is 5-10 lines of code.People. Seriously. It's like you've never heard the maxim of the Old French Republic: divide et impera (</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6283175166582539685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6283175166582539685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6283175166582539685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6283175166582539685'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/03/small-isuseful.html' title='Small is...useful'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2161651330650172085</id><published>2010-03-18T14:42:00.013Z</published><updated>2010-04-14T15:45:00.838+01:00</updated><title type='text'>Anonymouses Anonymous</title><summary type='text'>In my JavaScript work, I see a huge number of anonymous functions. I'm not a fan. In today's post I'd like to show the problem and how I like to get around it.The Short VersionThe short version of this post would be: Anonymous functions don't have names. Functions having names is a Good Thing(tm). So give them names.But what fun would that be? Read on...Anonymous FunctionsFirst off, what do I </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2161651330650172085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2161651330650172085' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2161651330650172085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2161651330650172085'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/03/anonymouses-anonymous.html' title='Anonymouses Anonymous'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1226506303629760571</id><published>2010-03-16T11:41:00.003Z</published><updated>2010-03-16T12:15:36.741Z</updated><title type='text'>...by any other name, would smell as sweet</title><summary type='text'>Although it's not a new problem, lately I've been seeing so many people running into a specific issue with Internet Explorer that I thought it worth just jotting down what the problem is and how to get around it.The problem, in brief, is conflation. Internet Explorer (v6 and v7) mixes together the namespaces of the id and name attributes, which should be completely distinct from one another. id, </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1226506303629760571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1226506303629760571' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1226506303629760571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1226506303629760571'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/03/by-any-other-name-would-smell-as-sweet.html' title='...by any other name, would smell as sweet'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2307042243273092963</id><published>2010-02-09T13:03:00.003Z</published><updated>2010-02-09T13:27:45.407Z</updated><title type='text'>catch...from</title><summary type='text'>A brief post off my usual JavaScript track for a digression into Java and related languages (although come to think of it, the concept below applies just as much to JavaScript as Java).Exception handling features in languages are fantastic. They let us (if we're careful and thorough) express the mainline logic of our code uninterrupted by the niggly little detail that just about anything can fail</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2307042243273092963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2307042243273092963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2307042243273092963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2307042243273092963'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2010/02/catchfrom.html' title='catch...from'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6699035637403119654</id><published>2009-12-17T13:53:00.003Z</published><updated>2009-12-17T13:59:03.654Z</updated><title type='text'>GET information, POST changes</title><summary type='text'>A micro-post, but this isn't said often enough: Don't use GET requests to change data server-side, use POST (for example, when using Ajax to modify things server-side). GETs are supposed to be idempotent, which is a fancy way of saying that doing them repeatedly has the same effect as doing them once. So, GET the contents of a message on a message board, but POST new messages to the board.More (</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6699035637403119654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6699035637403119654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6699035637403119654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6699035637403119654'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2009/12/get-information-post-changes.html' title='GET information, POST changes'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6089847706376114893</id><published>2009-10-13T12:59:00.004+01:00</published><updated>2009-10-13T13:41:04.876+01:00</updated><title type='text'>A better way to hide .htaccess, WEB-INF</title><summary type='text'>If you use Apache as your web server of choice, you may wish to have files or directories that Apache pretends are not there. For me, this is because I like to have Apache proxy a servlet container backend, but I'm too lazy to separate out the files, and so I just point Apache and the servlet container at the same directory and tell Apache to pass on the relevant requests to the servlet container</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6089847706376114893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6089847706376114893' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6089847706376114893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6089847706376114893'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2009/10/better-way-to-hide-htaccess-web-inf.html' title='A better way to hide .htaccess, WEB-INF'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4004866189761444001</id><published>2009-09-13T15:21:00.006+01:00</published><updated>2010-03-29T23:50:21.709+01:00</updated><title type='text'>Private Methods in JavaScript</title><summary type='text'>The question of truly private methods comes up intermittently in JavaScript mailing lists. Most respondents point to Crockford's solution, but then also point out how much memory it takes (each instance gets its own copy of methods; but on the up side, it also gives you truly private member variables as well as methods).Recently I've been switching to the module pattern for each class, thanks in </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4004866189761444001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4004866189761444001' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4004866189761444001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4004866189761444001'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2009/09/private-methods-in-javascript.html' title='Private Methods in JavaScript'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-4742726851690218350</id><published>2009-09-09T17:19:00.011+01:00</published><updated>2010-04-02T09:52:04.658+01:00</updated><title type='text'>Simple, Efficient Supercalls in JavaScript</title><summary type='text'>In this post, I'll be outlining a simple means of doing supercalls in JavaScript without causing unnecessary runtime overhead, running into maintenance issues, or falling afoul of the new "strict" mode of ECMAScript 5.The Short VersionThe mechanism in brief is:Have a "make a class" function (most libraries do).In that function, detect that a subclass is overriding a superclass function and, if so</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/4742726851690218350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=4742726851690218350' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4742726851690218350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/4742726851690218350'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2009/09/simple-efficient-supercalls-in.html' title='Simple, Efficient Supercalls in JavaScript'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-876026099464689467</id><published>2008-11-14T10:22:00.006Z</published><updated>2011-06-12T11:03:32.832+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='off-topic'/><title type='text'>COMPLETELY off-topic...</title><summary type='text'>...but if this doesn't gob-smack you, you're dead inside:http://news.bbc.co.uk/1/hi/sci/tech/7725584.stmI mean, we've known they were there, in theory, at least since Newton; we've known they were there, by observation (star wobbles, etc.), for 20 years.  But this is direct observation.  We can see them.  To me, this is a Neil Armstrong moment.</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/876026099464689467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=876026099464689467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/876026099464689467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/876026099464689467'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/11/completely-off-topic.html' title='COMPLETELY off-topic...'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/04145790374370437858</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5734543818132776064</id><published>2008-10-19T13:00:00.003+01:00</published><updated>2008-10-19T13:01:50.121+01:00</updated><title type='text'>Unobtrusiveness</title><summary type='text'>Another link-post today (although again a link to a snippet I've written, so not completey OT) since most of my writing time is going to the Unofficial Prototype &amp; script.aculo.us wiki at the moment: How To - Using Unobtrusive JavaScript</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5734543818132776064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5734543818132776064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5734543818132776064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5734543818132776064'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/10/unobtrusiveness.html' title='Unobtrusiveness'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5830750848748221014</id><published>2008-10-16T15:52:00.003+01:00</published><updated>2008-10-16T15:57:19.135+01:00</updated><title type='text'>Minimizing Download Times</title><summary type='text'>Hello all,That's right, first post since...wow, since April.  And it's not even a post, it's sort of a link-post.I've been doing some work helping build the Prototype user community (moderating the user discussion group, creating an unofficial wiki, that kind of thing) and as part of that I've been doing little mini-articles, much like the ones I expected to do here.So if you're writing web </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5830750848748221014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5830750848748221014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5830750848748221014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5830750848748221014'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/10/minimizing-download-times.html' title='Minimizing Download Times'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2678400766479808536</id><published>2008-04-01T17:30:00.006+01:00</published><updated>2011-06-12T10:59:32.402+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='pitfall'/><category scheme='http://www.blogger.com/atom/ns#' term='this'/><title type='text'>You must remember 'this'</title><summary type='text'>Of all the tech blogs in all the sites in all the worldwide web, you walk into mine...If you hang out in JavaScript-oriented newsgroups like these for any length of time, you will eventually see some variation of this question:Hey, why doesn't this work?function MyWidget(name){    this.name = name;    this.element = null;}MyWidget.prototype.showName = function(){    alert('The name is ' + </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2678400766479808536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2678400766479808536' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2678400766479808536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2678400766479808536'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/04/you-must-remember-this.html' title='You must remember &apos;this&apos;'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2655690554511749465</id><published>2008-03-29T12:59:00.006Z</published><updated>2010-03-21T10:11:35.608Z</updated><title type='text'>What's in a name?</title><summary type='text'>Micro-post today, folks:You see a fair bit of confusion from newbies in mailing lists around the "name" attribute vs. the "id" attribute. (Edit 21 March 2010: Confusion not helped by a bug in Internet Explorer; more here.) For instance, I recently saw a "how do I do this" -style post asking how to deal with a form, with the sample being:&lt;form name='form1'&gt;&lt;input type='checkbox' id='cb1'&gt;Checkbox </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2655690554511749465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2655690554511749465' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2655690554511749465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2655690554511749465'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/whats-in-name.html' title='What&apos;s in a name?'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-3456807625915222681</id><published>2008-03-24T22:00:00.009Z</published><updated>2011-06-12T10:59:38.170+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='method'/><category scheme='http://www.blogger.com/atom/ns#' term='this'/><title type='text'>Mythical methods</title><summary type='text'>We frequently talk about JavaScript objects having methods. This is just a convenient myth. JavaScript has functions, but it doesn't have methods.  It doesn't need them.  Its functions, combined with some syntactic sugar, are more than up to the job.What is a "method"?  I'd have to say that the definition given on Wikipedia is pretty good. As of this writing, it says a method is...a subroutine </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/3456807625915222681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=3456807625915222681' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3456807625915222681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3456807625915222681'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/mythical-methods.html' title='Mythical methods'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2769376066560065227</id><published>2008-03-24T18:15:00.012Z</published><updated>2009-12-09T07:36:53.313Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Prototype'/><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>Convenience Syntax in Examples</title><summary type='text'>This is a "meta" post, e.g., it's about the blog itself.In many of my posts, I give code examples to illustrate a point.  To avoid cluttering the examples up with browser-specific stuff, I'm using a couple of calls from the Prototype library.Actually, right now, just the one:  Event.observe().  This function hooks up an event handler in a way that is consistent across browsers, even Internet </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2769376066560065227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2769376066560065227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2769376066560065227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2769376066560065227'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/convenience-syntax-in-examples.html' title='Convenience Syntax in Examples'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-1044054371320864804</id><published>2008-03-18T14:40:00.011Z</published><updated>2011-07-22T11:10:37.362+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='scope'/><category scheme='http://www.blogger.com/atom/ns#' term='var'/><category scheme='http://www.blogger.com/atom/ns#' term='pitfall'/><title type='text'>The Horror of Implicit Globals</title><summary type='text'>This code should cause an error, right?function doSomething(){   var x;   x = 10;   y = 20;   alert('x = ' + x);   alert('y = ' + y);}Well, you'd think so, wouldn't you? (There's no declaration for y.) It doesn't, though. It also probably doesn't do what the author intended. Welcome to The Horror of Implicit Globals. The good news is that there's something we can do about it.Update 2010/03/31: </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/1044054371320864804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=1044054371320864804' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1044054371320864804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/1044054371320864804'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html' title='The Horror of Implicit Globals'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-6105645211848323190</id><published>2008-03-17T13:32:00.002Z</published><updated>2008-03-17T13:36:18.112Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>Now at blog.niftysnippets.org</title><summary type='text'>Just briefly, this blog is now at http://blog.niftysnippets.org, rather than http://niftysnippets.blogspot.com.  It's still hosted by Blogger (for now), and Blogger is kind enough to forward you from the old address, but if for some reason you're a regular reader of this blog, it's worth updating your Atom/RSS links just in case someday I end up hosting it myself or moving to Wordpress or </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/6105645211848323190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=6105645211848323190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6105645211848323190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/6105645211848323190'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/now-at-blogniftysnippetsorg.html' title='Now at blog.niftysnippets.org'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-3393811840522767991</id><published>2008-03-17T11:52:00.003Z</published><updated>2011-06-12T10:59:49.594+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='scope'/><title type='text'>When you absolutely, positively need new scope</title><summary type='text'>Just a quick one today, one that in many ways is a solution in search of a problem... ;-)As you probably know, in most of the languages with vaguely C-like syntax (C, C++, Java, C#, ...), a new block introduces new scope.  E.g., this Java code:String myJavaMethod(){    String s;    s = "outer string";    {        String s;        s = "inner string";        // (Presumably do something with 's' in </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/3393811840522767991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=3393811840522767991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3393811840522767991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3393811840522767991'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/when-you-absolutely-positively-need-new.html' title='When you absolutely, positively need new scope'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5949233004039052236</id><published>2008-03-16T11:09:00.005Z</published><updated>2008-03-26T11:45:07.672Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='design'/><title type='text'>A simple point about design</title><summary type='text'>A good friend of mine pointed me at this comic and I just had to share it. I've rarely seen this point put more...simply.</summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5949233004039052236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5949233004039052236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5949233004039052236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5949233004039052236'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/slightly-off-topic.html' title='A simple point about design'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2341573448995158355</id><published>2008-03-15T15:00:00.014Z</published><updated>2011-06-12T10:59:55.858+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='closures'/><category scheme='http://www.blogger.com/atom/ns#' term='scope'/><title type='text'>Closures by example</title><summary type='text'>In an earlier post, I promised a follow-up with a few examples of closures. Before we get to the examples, a quick note: To avoid cluttering things up with browser-specific stuff, I'm using the Event.observe() method from Prototype. Event.observe() hooks up an event handler, allowing for differences between browser implementations (see the link for more detail).I have to say that I found this </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2341573448995158355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2341573448995158355' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2341573448995158355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2341573448995158355'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/closures-by-example.html' title='Closures by example'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-3151804591489710788</id><published>2008-03-03T13:00:00.006Z</published><updated>2011-06-12T11:00:01.709+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='var'/><category scheme='http://www.blogger.com/atom/ns#' term='pitfall'/><title type='text'>Poor misunderstood 'var'</title><summary type='text'>It seems most programmers coming to JavaScript from C, C++, Java, and the like equate the var statement with variable declaration statements in the languages they come from and use it the same way. And at some casual level that's reasonable; but it can lead you down a misleading path...Consider this code:function foo(){    var ar;    // ...do some stuff, create an array in 'ar'...    for (var </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/3151804591489710788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=3151804591489710788' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3151804591489710788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/3151804591489710788'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/03/poor-misunderstood-var.html' title='Poor misunderstood &apos;var&apos;'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-2553763848169256182</id><published>2008-02-29T21:00:00.025Z</published><updated>2011-08-26T05:52:23.449+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='closures'/><category scheme='http://www.blogger.com/atom/ns#' term='scope'/><title type='text'>Closures are not complicated</title><summary type='text'>Note December 2010: The terminology I attribute to the ECMAScript spec below was from the then-current 3rd edition. The current 5th edition spec (there was no 4th edition) uses different terminology. At some point I'll get around to updating...)Closures seem to frighten people a bit. Partially I suspect this is down to the academic nature of the term "closure". It sounds like something </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/2553763848169256182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=2553763848169256182' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2553763848169256182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/2553763848169256182'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/02/closures-are-not-complicated.html' title='Closures are not complicated'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5776624389634991887</id><published>2008-02-18T17:30:00.003Z</published><updated>2011-06-12T11:00:13.830+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='operator'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>JavaScript's Curiously-Powerful OR Operator (||)</title><summary type='text'>The "or" operator (||). It seems innocuous enough:  A binary logical operator that returns true if either of its params is true, usually used in the context of a conditional statement:    if (a || b)Perhaps if you've been programming in any of several other high-level languages for a while, you expect that it won't evaluate the second param if the first one is true, something called </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5776624389634991887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5776624389634991887' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5776624389634991887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5776624389634991887'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/02/javascripts-curiously-powerful-or.html' title='JavaScript&apos;s Curiously-Powerful OR Operator (||)'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-542398624287876588.post-5295840437280908842</id><published>2008-02-14T12:17:00.004Z</published><updated>2011-06-12T10:58:32.402+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='welcome'/><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>Nifty Snippets</title><summary type='text'>Welcome to Nifty Snippets, my new blog for capturing little snippets of code and techniques (as well as engineering, business, and teamwork "lessons learned"). Initially the focus will be on Ajax stuff, and that means lots of JavaScript.Now, JavaScript is about 18 times more interesting than most people think. This is not a toy language, this is an incredibly rich, powerful, expressive language </summary><link rel='replies' type='application/atom+xml' href='http://blog.niftysnippets.org/feeds/5295840437280908842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=542398624287876588&amp;postID=5295840437280908842' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5295840437280908842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/542398624287876588/posts/default/5295840437280908842'/><link rel='alternate' type='text/html' href='http://blog.niftysnippets.org/2008/02/nifty-snippets.html' title='Nifty Snippets'/><author><name>T.J. Crowder</name><uri>http://www.blogger.com/profile/05828354736681391962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
