<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BarelyBlogging &#187; JavaScript</title>
	<atom:link href="http://www.barelyfitz.com/blog/archives/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barelyfitz.com/blog</link>
	<description>Patrick Fitzgerald of BarelyFitz Designs</description>
	<lastBuildDate>Thu, 13 Oct 2011 01:55:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>workaround for entity bug (?) in tabber</title>
		<link>http://www.barelyfitz.com/blog/archives/2007/02/06/527/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2007/02/06/527/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 13:25:49 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[DHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tabber]]></category>
		<category><![CDATA[tabbifier]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2007/02/06/527/</guid>
		<description><![CDATA[A user of my tabber script discovered that when his tab headings had an ampersand character like this:
&#60;h2&#62;Me &#38;amp; My Shadow&#60;/h2&#62;
Then the tab control displayed &#8220;&#38;amp;&#8221; instead of a single ampersand character.
It looks like this occurs because the JavaScript DOM function document.createTextNode() does not convert entities. However, it looks like innerHTML does convert entities, so [...]]]></description>
			<content:encoded><![CDATA[<p>A user of my <a href="http://www.barelyfitz.com/projects/tabber/">tabber</a> script discovered that when his tab headings had an ampersand character like this:</p>
<p><code>&lt;h2&gt;Me &amp;amp; My Shadow&lt;/h2&gt;</code></p>
<p>Then the tab control displayed &#8220;&amp;amp;&#8221; instead of a single ampersand character.</p>
<p>It looks like this occurs because the JavaScript DOM function document.createTextNode() does not convert entities. However, it looks like innerHTML does convert entities, so to fix your problem find the following line in <a href="http://www.barelyfitz.com/projects/tabber/tabber.js">tabber.js</a>:</p>
<p><code>DOM_a.appendChild(document.createTextNode(t.headingText));</code></p>
<p>and replace with the following:</p>
<p><code>DOM_a.innerHTML = t.headingText;</code></p>
<p>I&#8217;ll think about this some more and if I can&#8217;t find any bad side effects I&#8217;ll add to the tabber code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2007/02/06/527/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Including dojo the easy (buggy) way</title>
		<link>http://www.barelyfitz.com/blog/archives/2007/01/10/512/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2007/01/10/512/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 22:08:40 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2007/01/10/512/</guid>
		<description><![CDATA[While trying out Dojo using the new easy include method, I found a weird JavaScript bug in IE6:
If you use a document.write() to write two script elements on the page, then instead of running the first script followed by the second script, IE apparently runs them both at the same time. This can cause an [...]]]></description>
			<content:encoded><![CDATA[<p>While trying out <a href="http://dojotoolkit.org/">Dojo</a> using the new <a href="http://alex.dojotoolkit.org/?p=591">easy include method</a>, I found a weird JavaScript bug in IE6:</p>
<p>If you use a document.write() to write two script elements on the page, then instead of running the first script followed by the second script, IE apparently runs them both at the same time. This can cause an error if the second script calls a function that is defined in the first script.</p>
<p>The dojo bug and some test cases are in <a href="http://trac.dojotoolkit.org/ticket/2280">Bug #2280</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2007/01/10/512/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LazyScript (made up word of the day)</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/09/05/424/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/09/05/424/#comments</comments>
		<pubDate>Tue, 05 Sep 2006 13:06:14 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/09/05/424/</guid>
		<description><![CDATA[LazyScript (n): a solution coded in JavaScript that should have been implemented with server-side coding. The resulting solution works in most browsers, but does not work when JavaScript is disabled, is not accessible, and does not appear in search engines. See also: kludge, hack
]]></description>
			<content:encoded><![CDATA[<p>LazyScript (n): a solution coded in JavaScript that should have been implemented with server-side coding. The resulting solution works in most browsers, but does not work when JavaScript is disabled, is not accessible, and does not appear in search engines. See also: kludge, hack</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/09/05/424/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to beg</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/05/03/357/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/05/03/357/#comments</comments>
		<pubDate>Wed, 03 May 2006 16:39:28 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/05/03/357/</guid>
		<description><![CDATA[
I provide some free open source software, and to help defray the costs of this website, I usually beg for PayPal donations.
Here&#8217;s a JavaScript function I use, attached to the download link, to annoy people into sending me a donation:
function begForMoney()
{
  if (!arguments.callee.stopBegging) {
    arguments.callee.stopBegging = true;
    alert("Please [...]]]></description>
			<content:encoded><![CDATA[<div class=shadow><img id="image358" src="http://www.barelyfitz.com/blog/upload/beg.jpg" alt="dog begging" /></div>
<p>I provide some free <a href="http://www.barelyfitz.com/projects/">open source software</a>, and to help defray the costs of this website, I usually beg for PayPal donations.</p>
<p>Here&#8217;s a JavaScript function I use, attached to the download link, to annoy people into sending me a donation:</p>
<pre style="clear:both">function begForMoney()
{
  if (!arguments.callee.stopBegging) {
    arguments.callee.stopBegging = true;
    alert("Please donate!");
  }
}</pre>
<p>Here&#8217;s how to attach it to a link. You can attach it to multiple links on the page, and it only triggers an alert the first time it is clicked.</p>
<pre>&lt;a href="" onclick="begForMoney()"&gt;Download&lt;/a&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/05/03/357/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FauxJAX: An AJAX Framework for Idiots</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/04/13/334/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/04/13/334/#comments</comments>
		<pubDate>Thu, 13 Apr 2006 13:26:11 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/04/13/334/</guid>
		<description><![CDATA[
Introducing FauxJAX.
Want to get your hands on some crazy delicious Web 2.0 venture capital, but don&#8217;t have mad AJAX skills? If you can copy and paste, you too can have a website that looks oh-so two thousand and six!
Simply use our framework to display content on your site, and we&#8217;ll do the rest. Don&#8217;t worry [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow"><img src="http://www.barelyfitz.com/projects/faux-jax/faux-jax.jpg" alt="fake eyball"/></div>
<p>Introducing <a href="http://www.barelyfitz.com/projects/faux-jax/">FauxJAX</a>.</p>
<p>Want to get your hands on some crazy delicious Web 2.0 venture capital, but don&#8217;t have mad AJAX skills? If you can copy and paste, you too can have a website that looks oh-so two thousand and six!</p>
<p>Simply use our framework to display content on your site, and we&#8217;ll do the rest. Don&#8217;t worry about outdated server-side technology because FauxJax is beyond all that. Way beyond. Like in the next century, you have no idea.</p>
<p><a href="http://www.barelyfitz.com/projects/faux-jax">Get FauxJAX today!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/04/13/334/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Three more things you should not do in JavaScript</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/04/11/328/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/04/11/328/#comments</comments>
		<pubDate>Tue, 11 Apr 2006 20:11:27 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/04/11/328/</guid>
		<description><![CDATA[
On the Yahoo! user interface blog I just saw their post &#8220;with Statement Considered Harmful&#8220;. Good advice.
Here are a few more things that I never do in JavaScript:

 Never use the &#8220;with&#8221; statement (as described above)
 Never use single line &#8220;//&#8221; comments. Use &#8220;/**/&#8221;. One day your code is going to be mangled and the [...]]]></description>
			<content:encoded><![CDATA[<div class=shadow><img id="image329" src="http://www.barelyfitz.com/blog/upload/see-no-evil.jpg" alt="see-no-evil.jpg" /></div>
<p>On the Yahoo! user interface blog I just saw their post &#8220;<a href="http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/">with Statement Considered Harmful</a>&#8220;. Good advice.</p>
<p>Here are a few more things that I never do in JavaScript:</p>
<ol>
<li> Never use the &#8220;with&#8221; statement (as described above)</li>
<li> Never use single line &#8220;//&#8221; comments. Use &#8220;/**/&#8221;. One day your code is going to be mangled and the newlines removed (perhaps by a crappy content management system), and suddenly your code will be commented out.
<p>Before:</p>
<pre>// a comment
alert('ping!');</pre>
<p>After: (UH OH!)</p>
<pre>// a comment alert('ping!');</pre>
</li>
<li> Never omit the semi-colon after a statement. Again, this is to protect your code in case the newlines are removed, and to make the code easier to parse (by humans and machines).
<p>Before:</p>
<pre>var t = 'ping!'
alert('ping!')</pre>
<p>After: (ERROR)</p>
<pre>var t = 'ping!' alert('ping!')</pre>
<p>This can be harder than it seems! For example, in the following example you should add a semi-colon after the closing brace:</p>
<pre>var myFunc =
function() {
alert('ping!');
}</pre>
</li>
<li> Never omit the optional brackets { } around a statement. This can prevent some hard-to-debug errors when you add and remove code.
<p>Before: (MISLEADING INDENT!)</p>
<pre>if (true)
    alert('ping!');
    deleteItem();</pre>
<p>Fixed: (UNAMBIGUOUS)</p>
<pre>if (true) {
    alert('ping!');
}
deleteItem();</pre>
</li>
</ol>
<p>To check your code for missing semicolons and brackets, use <a href="http://www.jslint.com">JSLint</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/04/11/328/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmarklet to search current site using Google</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/04/10/321/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/04/10/321/#comments</comments>
		<pubDate>Mon, 10 Apr 2006 15:56:36 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[bookmarklet]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/04/10/321/</guid>
		<description><![CDATA[(This has been done before, but I&#8217;m putting my own spin on it.)
I often use Google to search a particular website, using &#8220;site:example.com&#8221; and my search terms. It gets a bit tedious entering &#8220;site:example.com&#8221;, so I made the following bookmarklet:

Search Current Site Bookmarklet

It prompts for the search terms, automatically adds the &#8220;site:&#8221; keyword and domain [...]]]></description>
			<content:encoded><![CDATA[<p>(This has been done before, but I&#8217;m putting my own spin on it.)</p>
<p>I often use Google to search a particular website, using &#8220;site:example.com&#8221; and my search terms. It gets a bit tedious entering &#8220;site:example.com&#8221;, so I made the following bookmarklet:</p>
<ul>
<li><a href="javascript:(function(){var h,q;h=location.hostname;q=(window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);q=prompt('Search \''+h+'\' using Google:',q);if(q!=null){if(h){q='site:'+h+' '+q;}location='http://www.google.com/search?q='+encodeURIComponent(q);}})();">Search Current Site Bookmarklet</a></li>
</ul>
<p>It prompts for the search terms, automatically adds the &#8220;site:&#8221; keyword and domain name, then goes to Google. You can select some text on the page before you click the bookmarklet, and your selected text will be used as the default search keywords.</p>
<p>For Firefox just drag-and-drop the link to your bookmarks toolbar. For IE, right-click the link then select &#8220;Add to Favorites&#8230;&#8221; (you might get a warning message since the bookmark contains javascript) then add it to your Links toolbar.</p>
<p>Inspired by: <a href="http://www.squarefree.com/bookmarklets/search.html">Search Bookmarklets</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/04/10/321/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>JavaScript tabbifier v1.7 new features</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/04/10/314/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/04/10/314/#comments</comments>
		<pubDate>Mon, 10 Apr 2006 05:27:49 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[tabber]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/04/10/314/</guid>
		<description><![CDATA[
I just released a new version of my JavaScript tab interface software.
New Features

Can automatically set a unique id for each tab navigation link, which allows you to individually style each tab.
Includes a &#8220;minimized&#8221; version of the code (with comments and whitespace removed, for extra-fast loading).

]]></description>
			<content:encoded><![CDATA[<div style="margin: 0pt 1em 1em 0pt; float: right"><img id="image282" alt="Tabber" src="http://www.barelyfitz.com/blog/upload/tabber.png" /></div>
<p>I just released a new version of my <a href="http://www.barelyfitz.com/projects/tabber/">JavaScript tab interface</a> software.</p>
<h3>New Features</h3>
<ul>
<li>Can automatically set a unique id for each tab navigation link, which allows you to individually style each tab.</li>
<li>Includes a &#8220;minimized&#8221; version of the code (with comments and whitespace removed, for extra-fast loading).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/04/10/314/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>JavaScript tab interface with persistent tabs</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/04/07/309/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/04/07/309/#comments</comments>
		<pubDate>Fri, 07 Apr 2006 05:38:45 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[DHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[tabber]]></category>
		<category><![CDATA[tabbifier]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/04/07/309/</guid>
		<description><![CDATA[
Now with yummy cookies!
I added an example page showing how you can use the new onLoad and onClick function hooks in my JavaScript tabifier to make the tabs persistent (using browser cookies).
That is, if you leave the page and come back later, the tab you previously selected will still be selected.
]]></description>
			<content:encoded><![CDATA[<div class="shadow"><img id="image308" alt="cookies" src="http://www.barelyfitz.com/blog/upload/cookies.jpg" /></div>
<p>Now with yummy cookies!</p>
<p>I added an example page showing how you can use the new onLoad and onClick function hooks in my <a href="http://www.barelyfitz.com/projects/tabber/">JavaScript tabifier</a> to make the tabs persistent (using browser cookies).</p>
<p>That is, if you leave the page and come back later, the tab you previously selected will still be selected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/04/07/309/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Screencast: Judge a Web App By Its Title</title>
		<link>http://www.barelyfitz.com/blog/archives/2006/04/06/305/</link>
		<comments>http://www.barelyfitz.com/blog/archives/2006/04/06/305/#comments</comments>
		<pubDate>Thu, 06 Apr 2006 13:02:15 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Blogger]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[YKMH]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[information architecture]]></category>
		<category><![CDATA[power user]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.barelyfitz.com/blog/archives/2006/04/06/305/</guid>
		<description><![CDATA[
The second episode of &#8220;You&#8217;re Killing Me Here!&#8221; (usability and design screencast series) discusses various uses of the page title (HTML TITLE element): in particular how you can use it to communicate with users of your web application.

View the Screencast (2.5 minutes)
]]></description>
			<content:encoded><![CDATA[<div class="shadow"><a href="http://www.barelyfitz.com/screencast/ykmh/"><img id="image276" alt="You're Killing Me Here!" src="http://www.barelyfitz.com/blog/upload/ykmh-logo-small.jpg" /></a></div>
<p>The second episode of &#8220;You&#8217;re Killing Me Here!&#8221; (usability and design screencast series) discusses various uses of the page title (HTML TITLE element): in particular how you can use it to communicate with users of your web application.<br />
<a href="http://www.barelyfitz.com/screencast/ykmh/ykmh-02-title/" /></p>
<p><a href="http://www.barelyfitz.com/screencast/ykmh/ykmh-02-title/">View the Screencast</a> (2.5 minutes)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barelyfitz.com/blog/archives/2006/04/06/305/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

