<?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>Now here's a thought &#187; Javascript</title>
	<atom:link href="http://rick.measham.id.au/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://rick.measham.id.au</link>
	<description>Random thoughts from a random brain</description>
	<lastBuildDate>Sat, 19 Sep 2009 13:21:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Give Up and Use Tables</title>
		<link>http://rick.measham.id.au/200901/give-up-and-use-tables/</link>
		<comments>http://rick.measham.id.au/200901/give-up-and-use-tables/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 12:41:45 +0000</pubDate>
		<dc:creator>RickMeasham</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://rick.measham.id.au/?p=116</guid>
		<description><![CDATA[(If you don&#8217;t write HTML, you can skip this post. It doesn&#8217;t concern you and will just confuse you. Basically: there&#8217;s a weird bunch of people who want to avoid a particularly useful way to lay out a web page just because they hold to this notion that &#8220;tables are for data&#8221;, and the fact [...]]]></description>
			<content:encoded><![CDATA[<p><em>(If you don&#8217;t write HTML, you can skip this post. It doesn&#8217;t concern you and will just confuse you. Basically: there&#8217;s a weird bunch of people who want to avoid a particularly useful way to lay out a web page just because they hold to this notion that &#8220;tables are for data&#8221;, and the fact that they make page layout a breeze is immaterial.)</em></p>
<p>I hereby promise not to rant. Much.</p>
<p>Hey all you zealots .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you have to have a meaningless &lt;div&gt;, you&#8217;re no longer semantic .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you have to use Microsoft&#8217;s conditional comments just to get it to work in Internet explorer .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you have to ask a chat room or forum how to get your three-column layout to work .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you need to vertically center one piece of content against another .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you spend more time arguing with someone than you can save by avoiding tables .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you care so much about avoiding tables that you don&#8217;t have any time left to help people with their actual problem  .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>If you end up with classes in your CSS that are designed to give you the benefits of tables without using a table tag .. <a href="http://giveupandusetables.com/">give up and use tables</a>.</p>
<p>Seriously folks, you&#8217;re spending too much time avoiding them and proselytizing about your avoidance of them and not enough time creating useful content that the semantic nature of that content is worthless.</p>
<h2>Update:</h2>
<p>Woohoo! I just got banned from #html on freenode because I argued for using tables. There was no argument and no discussion. (OK, so I was mocking his inability to justify his contention, but seriously? banned?) BTW: I&#8217;m &#8216;Woosta&#8217;, &#8216;[wito'] is the zealot in question.</p>
<blockquote><p>[22:53] &lt;to_&gt; which tag would you use to wrap &lt;label&gt; + &lt;input&gt; tags in a form?<br />
[22:53] &lt;[wito]&gt; to_: I&#8217;m a fan of &lt;fieldset&gt;&lt;label&gt;&lt;span&gt;Text:&lt;/span&gt; &lt;input/&gt;&lt;/label&gt;&lt;/fieldset&gt;<br />
[22:54] &lt;Woosta&gt; I think it would be best defined by the design<br />
[22:55] &lt;to_&gt; [wito]: but if you want to make input floating to the right of label in a 2 columns presentation layout, don&#8217;t you use a wrapping tag to clear float ?<br />
[22:56] &lt;[wito]&gt; to_: actually, I use a display:table hierarchy<br />
[22:58] &lt;Woosta&gt; just use a table<br />
[22:59] &lt;[wito]&gt; Woosta: WRONG<br />
[22:59] &lt;Woosta&gt; no: it works and it&#8217;s fast<br />
[22:59] &lt;Woosta&gt; piss farting around with CSS is a poor use of your time<br />
[23:00] &lt;[wito]&gt; Woosta: protip: you don&#8217;t argue with me. <img src='http://rick.measham.id.au/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
[23:00] &lt;Woosta&gt; Bwahahahahha<br />
[23:00] &lt;[wito]&gt; Especially not when I tell you to stop offering destructive, counterproductive advice as you are now<br />
[23:01] &lt;Woosta&gt; Zealots make me laugh<br />
[23:01] &lt;[wito]&gt; How about you spend some time in the quiet corner?<br />
[23:02] &lt;Woosta&gt; Why me? I have plenty of time up my sleeve. I think you need the time out so you can get some work done as your stupid-ass CSS crap takes you 20 times longer than a simple table would.<br />
[23:03] [Notice] -ChanServ- You have been quieted on #html by [wito] (wito)<br />
[23:03] *** ChanServ sets a ban on __________.<br />
[23:03] &lt;[wito]&gt; Let&#8217;s have some quiet time for Woosta</p></blockquote>
<h2>Update 2:</h2>
<p>Found <a href="http://www.zazzle.com/css_is_awesome_mug-168716435071981928">this funny mug</a> on Zazzle</p>
]]></content:encoded>
			<wfw:commentRss>http://rick.measham.id.au/200901/give-up-and-use-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notary for Thunderbird 2.x</title>
		<link>http://rick.measham.id.au/200711/notary-for-thunderbird-2x/</link>
		<comments>http://rick.measham.id.au/200711/notary-for-thunderbird-2x/#comments</comments>
		<pubDate>Sun, 25 Nov 2007 09:45:48 +0000</pubDate>
		<dc:creator>RickMeasham</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://rick.measham.id.au/200711/notary-for-thunderbird-2x/</guid>
		<description><![CDATA[I needed the functionality provided by Notary, David Cooper&#8217;s Thunderbird extension for adding notes to an email. However it wasn&#8217;t compatible with Thunderbird 2.x and despite requests to the Mozilla extensions directory no update was forthcoming.
Therefore, I&#8217;ve taken it upon myself to &#8216;hack&#8217; compatibility and offer the hacked file to anyone who wants it. The [...]]]></description>
			<content:encoded><![CDATA[<p>I needed the functionality provided by <a href="https://addons.mozilla.org/en-US/thunderbird/addon/979">Notary, David Cooper&#8217;s Thunderbird extension</a> for adding notes to an email. However it wasn&#8217;t compatible with Thunderbird 2.x and despite requests to the Mozilla extensions directory no update was forthcoming.</p>
<p>Therefore, I&#8217;ve taken it upon myself to &#8216;hack&#8217; compatibility and offer the hacked file to anyone who wants it. The extension doesn&#8217;t come with any license information therefore I must assume it is closed source, and therefore this is not any sort of official release to the point where it may be breaching Mr Cooper&#8217;s copyright to post it. Should I ever hear from him anywhere, I&#8217;ll be sure to clarify the licensing!</p>
<p>You can <a href="http://rick.measham.id.au/paste/notary-2.1.xpi">download the file from here</a>.</p>
<p><strong>Edit:</strong> Note that in order to get it working, I&#8217;ve removed some button that used to be in the &#8216;Extended Headers&#8217; view. It toggled display of the notes panel. I&#8217;m not interested in this feature as I can drag the panel on or off, and I&#8217;m not interested in maintaining the module going forward so I&#8217;m not going to work out how to get it back.</p>
<p><strong>Edit 2</strong>: There may be a problem showing the pane by dragging.</p>
<p><strong>Edit 2b</strong>: Problems fixed. Should work as per 1.x now. The button in the extended headers is back. New version is 2.1.</p>
]]></content:encoded>
			<wfw:commentRss>http://rick.measham.id.au/200711/notary-for-thunderbird-2x/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Javascript Color picker</title>
		<link>http://rick.measham.id.au/200606/javascript-color-picker/</link>
		<comments>http://rick.measham.id.au/200606/javascript-color-picker/#comments</comments>
		<pubDate>Thu, 29 Jun 2006 03:44:20 +0000</pubDate>
		<dc:creator>RickMeasham</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wp.rick.measham.id.au/?p=19</guid>
		<description><![CDATA[Having seen various color pickers that ask you to click on a tiny sample to select a color, I decided it was time to do something more useful. First I wrote color.js, a library for creating, converting and using colors in various ways. Then I got my scrollcontrol.js that uses a scrollbar to select a [...]]]></description>
			<content:encoded><![CDATA[<p>Having seen various color pickers that ask you to click on a tiny sample to select a color, I decided it was time to do something more useful. First I wrote <a href="http://rick.measham.id.au/paste/color.js" target="_blank">color.js</a>, a library for creating, converting and using colors in various ways. Then I got my <a href="http://rick.measham.id.au/paste/scrollcontrol.js" target="_blank">scrollcontrol.js</a> that uses a scrollbar to select a numerical value between two points. Used many scroll controls to select values for colors, plus added a mixer and created my <a href="http://rick.measham.id.au/paste/colorpoc.htm" target="_blank">colorpoc.htm</a>. Currently it works best on Firefox. KHTML has a problem with the scroll control that&#8217;s not really on the radar to fix (though patches are always welcome). IE doesn&#8217;t hide the RGB/HSV mixers correctly (why can&#8217;t it just behave?)</p>
]]></content:encoded>
			<wfw:commentRss>http://rick.measham.id.au/200606/javascript-color-picker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jif, It&#8217;s the new Ajax!</title>
		<link>http://rick.measham.id.au/200606/jif-its-the-new-ajax/</link>
		<comments>http://rick.measham.id.au/200606/jif-its-the-new-ajax/#comments</comments>
		<pubDate>Tue, 20 Jun 2006 03:40:42 +0000</pubDate>
		<dc:creator>RickMeasham</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wp.rick.measham.id.au/?p=18</guid>
		<description><![CDATA[I&#8217;ve decided that AJAX is a really, really annoying acronym. Aynchronous Javascript and XML. Firstly it doesn&#8217;t have to be asynchronous (though it&#8217;s best if it is) but mainly it doesn&#8217;t have to have anything to do with XML. In fact you&#8217;re better off using some other data serialisation method like JSON .. JavaScript Object [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided that AJAX is a really, really annoying acronym. Aynchronous Javascript and XML. Firstly it doesn&#8217;t have to be asynchronous (though it&#8217;s best if it is) but mainly it doesn&#8217;t have to have <em>anything</em> to do with XML. In fact you&#8217;re better off using some other data serialisation method like <a href="http://www.json.org/">JSON</a> .. JavaScript Object Notation. Which, as the name suggests, is fairly native to Javascript.  Anyway, I&#8217;m getting side-tracked</p>
<p>The point of this post is to introduce you to JIF, or the Javascript Intercommunication Framework. Sure it&#8217;s a mouthful, but it&#8217;s more meaningful. You use it with Javascript to communicate in both directions with your server without reloading pages.<br />
Oh and yes, I&#8217;ll admit it: it&#8217;s a reverse acronym &#8212; an acronym in search of a meaning.</p>
<hr />
<h2>JIF Library</h2>
<p>So now you&#8217;re convinced that JIF is a better name than AJAX, you&#8217;ll need a library. Of course there&#8217;s nothing stopping you from continuing to use your old AJAX libraries, you can use them for JIF too, it&#8217;s just a re-branding. However I feel that most AJAX libraries are overly bloated. They do so much more than just communicate with your server. If you want widgets, then either load an extra widget file, or write it yourself. Most widgets are fairly easy.</p>
<p>Download here: <a href="http://rick.measham.id.au/javascript/jif.js" target="_blank" title="Download JIF.js library">JIF.js</a></p>
<p>Now you have the file, let&#8217;s take a look at how to use it. Here&#8217;s an example:</p>
<pre class="javascript">
<ol>
<li class="li1">
<p class="de1">jifGetJSON<span class="br0">(</span>
</li>
<li class="li1">
<p class="de1">   <span class="st0">'/paste/jif.test.json.txt'</span>,
</li>
<li class="li1">
<p class="de1">   <span class="br0">{</span> random: <span class="st0">"parameter"</span> <span class="br0">}</span>,
</li>
<li class="li1">
<p class="de1">   <span class="kw2">function</span><span class="br0">(</span>o<span class="br0">)</span><span class="br0">{</span>
</li>
<li class="li1">
<p class="de1">      <span class="kw3">alert</span><span class="br0">(</span>o.<span class="me1">message</span><span class="br0">)</span>
</li>
<li class="li1">
<p class="de1">   <span class="br0">}</span>
</li>
<li class="li1">
<p class="de1"><span class="br0">)</span>;
</li>
</ol>
</pre>
<p>Line 2 is the URL we&#8217;re going to ask for information. JIF uses XMLHttpRequest (another misnamed function) to talk to the server and so it can only talk to the same server that we&#8217;re currently on, thus I don&#8217;t bother using full URLs.</p>
<p>Line 3 is an anonymous object that contains the parameters we want to send to the URL. In a GET request, like the above, they get translated into the query string, and so we really request jif.json.txt?random=parameter. In a POST request, it gets translated into the request body. Using a javascript object like this make it much easier to pass javascript data back and forth. There&#8217;s nothing stopping you passing an array as a parameter: { data: [1, 2, 3, 4] } will get translated into jif.json.txt?data=1&amp;data=2&amp;data=3&amp;data=4</p>
<p>Line 4 starts the handler function. Because jifGetJSON is asynchronous we can&#8217;t just pass the value back to the caller. The o parameter is the JSON object returned by the server from our request. As it&#8217;s a proper javascript object, we don&#8217;t need to do any post-processing.</p>
<p>Line 5 just pops up an alert containing the &#8216;message&#8217; attribute from the object the server returned.</p>
<p>It&#8217;s that easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://rick.measham.id.au/200606/jif-its-the-new-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
