<?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>Navarr&#039;s Tech Side &#187; javascript</title>
	<atom:link href="http://tech.navarr.me/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://tech.navarr.me</link>
	<description>The Technical Side of my Life</description>
	<lastBuildDate>Sun, 05 Feb 2012 05:10:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='tech.navarr.me' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Node.JS</title>
		<link>http://tech.navarr.me/2011/07/node-js.html</link>
		<comments>http://tech.navarr.me/2011/07/node-js.html#comments</comments>
		<pubDate>Sat, 23 Jul 2011 16:39:21 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[Node.JS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://tech.navarr.me/?p=537</guid>
		<description><![CDATA[So, despite the fact that I know excessively little about how to work Node.JS, especially when coming from a PHP background - I am beyond obsessed with the language. So it thrills me to no end that there is now a Node.JS executable for Windows. Of course, things kind of suck when you don't have [...]]]></description>
			<content:encoded><![CDATA[<p>So, despite the fact that I know excessively little about how to work Node.JS, especially when coming from a PHP background - I am beyond obsessed with the language.</p>
<p>So it thrills me to no end that there is now a Node.JS executable for Windows.</p>
<p>Of course, things kind of suck when you don't have the super simple power of NPM, but that's life for ya.</p>
<p>I understand the basics of Node.JS (If you've ever touched JavaScript, its hard <strong>NOT</strong> to); but some fine details such as templating elude me.  Maybe you're not supposed to template?  Maybe you're just supposed to serve up some static HTML that then queries the Node.JS server for the information it needs?  Oh.. now there's a thought.. program a single frontend that just talks back and forth with the backend.  Kind of like Google+, actually.</p>
<p>Is that what I'm supposed to do?  God I love this language.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2011/07/node-js.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making Google Analytics Work in XHTML</title>
		<link>http://tech.navarr.me/2010/04/making-google-analytics-work-in-xhtml.html</link>
		<comments>http://tech.navarr.me/2010/04/making-google-analytics-work-in-xhtml.html#comments</comments>
		<pubDate>Sun, 04 Apr 2010 16:37:29 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[(X)HTML 5]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[xhtml]]></category>
		<category><![CDATA[xhtml5]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/?p=431</guid>
		<description><![CDATA[I was moving my website, Google Voice for Outlook, over from HTML5 to XHTML5 today, and as soon as I did the basic content negotiation filters in PHP so that it would send the appropriate headers if the client supported XHTML as well as only outputting the &#60;?xml if the client supported XHTML, I checked [...]]]></description>
			<content:encoded><![CDATA[<p>I was moving my website, Google Voice for Outlook, over from HTML5 to XHTML5 today, and as soon as I did the basic content negotiation filters in PHP so that it would send the appropriate headers if the client supported XHTML as well as only outputting the &lt;?xml if the client supported XHTML, I checked my developer tools to find a JavaScript error.  It was Google Analytics, of course.  document.write doesn’t exist in XHTML, after all.</p>
<p>The fix was simple, replace the current four line inclusion code with:</p>
<pre><div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #003366; font-weight: bold;">var</span> gaJsHost <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;https:&quot;</span> <span style="color: #339933;">==</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">protocol</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;https://ssl.&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	script.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> gaJsHost <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;google-analytics.com/ga.js&quot;</span><span style="color: #339933;">;</span>
	script.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">;</span>
	document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div></pre>
<p>This will work fine, unless of course you have no head tag.  In which case you should replace getElementsByTagName(“head”) with getElementsByTagName(“html”).</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2010/04/making-google-analytics-work-in-xhtml.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Retrieve a Zipcode Using JavaScript</title>
		<link>http://tech.navarr.me/2010/02/how-to-retrieve-a-zipcode-using-javascript.html</link>
		<comments>http://tech.navarr.me/2010/02/how-to-retrieve-a-zipcode-using-javascript.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 16:59:51 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[reverse geocoding]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/?p=375</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre><div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Retrieve user’s Zipcode</span>
<span style="color: #006600; font-style: italic;">// Demo at http://sandbox.gtaero.net/zipcode.html</span>
<span style="color: #003366; font-weight: bold;">function</span> retrieve_zip<span style="color: #009900;">&#40;</span>callback<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>google<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> google <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> google <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #006600; font-style: italic;">// Stupid Exceptions</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">geolocation</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// FireFox/HTML5 GeoLocation</span>
	<span style="color: #009900;">&#123;</span>
		navigator.<span style="color: #660066;">geolocation</span>.<span style="color: #660066;">getCurrentPosition</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>position<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			zip_from_latlng<span style="color: #009900;">&#40;</span>position.<span style="color: #660066;">coords</span>.<span style="color: #660066;">latitude</span><span style="color: #339933;">,</span>position.<span style="color: #660066;">coords</span>.<span style="color: #660066;">longitude</span><span style="color: #339933;">,</span>callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>google <span style="color: #339933;">&amp;&amp;</span> google.<span style="color: #660066;">gears</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// Google Gears GeoLocation</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> geloc <span style="color: #339933;">=</span> google.<span style="color: #660066;">gears</span>.<span style="color: #660066;">factory</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'beta.geolocation'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		geloc.<span style="color: #660066;">getPermission</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		geloc.<span style="color: #660066;">getCurrentPosition</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>position<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			zip_from_latlng<span style="color: #009900;">&#40;</span>position.<span style="color: #660066;">latitude</span><span style="color: #339933;">,</span>position.<span style="color: #660066;">longitude</span><span style="color: #339933;">,</span>callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> zip_from_latlng<span style="color: #009900;">&#40;</span>latitude<span style="color: #339933;">,</span>longitude<span style="color: #339933;">,</span>callback<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// Setup the Script using Geonames.org's WebService</span>
		<span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		script.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://ws.geonames.org/findNearbyPostalCodesJSON?lat=&quot;</span> <span style="color: #339933;">+</span> latitude <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&amp;lng=&quot;</span> <span style="color: #339933;">+</span> longitude <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&amp;callback=&quot;</span> <span style="color: #339933;">+</span> callback<span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// Run the Script</span>
		document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> example_callback<span style="color: #009900;">&#40;</span>json<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// Now we have the data!  If you want to just assume it's the 'closest' zipcode, we have that below:</span>
	zip <span style="color: #339933;">=</span> json.<span style="color: #660066;">postalCodes</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">postalCode</span><span style="color: #339933;">;</span>
	country <span style="color: #339933;">=</span> json.<span style="color: #660066;">postalCodes</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">countryCode</span><span style="color: #339933;">;</span>
	state <span style="color: #339933;">=</span> json.<span style="color: #660066;">postalCodes</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">adminName1</span><span style="color: #339933;">;</span>
	county <span style="color: #339933;">=</span> json.<span style="color: #660066;">postalCodes</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">adminName2</span><span style="color: #339933;">;</span>
	place <span style="color: #339933;">=</span> json.<span style="color: #660066;">postalCodes</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">placeName</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>zip<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
retrieve_zip<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;example_callback&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Alert the User's Zipcode</span></pre></div></div></pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2010/02/how-to-retrieve-a-zipcode-using-javascript.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Quick Update to Simple Twitter</title>
		<link>http://tech.navarr.me/2010/01/a-quick-update-to-simple-twitter.html</link>
		<comments>http://tech.navarr.me/2010/01/a-quick-update-to-simple-twitter.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 23:40:52 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[SimpleTwitter]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2010/01/a-quick-update-to-simple-twitter.html</guid>
		<description><![CDATA[A lot of people use my Simple Twitter Feed written in JavaScript (for some reason).&#160; Well, today I pushed out a quick update that should fix all the woes users have given me in the past. The code should now be valid XHTML strict, and I know longer use innerHTML for each list element.&#160; Instead, [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people use my Simple Twitter Feed written in JavaScript (for some reason).&#160; Well, today I pushed out a quick update that should fix all the woes users have given me in the past.</p>
<p>The code should now be valid XHTML strict, and I know longer use innerHTML for each list element.&#160; Instead, I’ve moved from adding the list elements via innerHTML to DOM Manipulation (appendChild).&#160; I’m not sure exactly what the benefits of this are, but I’m sure they exist.</p>
<p>As the previous HTML code seems to have been broken, this may cause some rendering errors for a few websites, but all in all it should work better than it has previously.</p>
<p>I’m not writing out a whole changelog, I’m just going ahead and saying that some changes were made – and hopefully Simple Twitter should work a lot easier for everyone using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2010/01/a-quick-update-to-simple-twitter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webkit JavaScript Notifications API</title>
		<link>http://tech.navarr.me/2010/01/webkit-javascript-notifications-api.html</link>
		<comments>http://tech.navarr.me/2010/01/webkit-javascript-notifications-api.html#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:29:51 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[desktop notifications]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2010/01/webkit-javascript-notifications-api.html</guid>
		<description><![CDATA[Something I learned about recently by following the updates being issued to Chrome, is that with today’s release they also pushed out the Webkit Notifications API to Chrome Stable (v4).&#160; Surprisingly, this is actually the first I’ve heard of it’s existence.&#160; I took a look and played around with it a bit, and it is [...]]]></description>
			<content:encoded><![CDATA[<p>Something I learned about recently by following the updates being issued to Chrome, is that with today’s release they also pushed out the Webkit Notifications API to Chrome Stable (v4).&#160; Surprisingly, this is actually the first I’ve heard of it’s existence.&#160; I took a look and played around with it a bit, and it is qué cool.</p>
<p>Visit <a href="http://sandbox.gtaero.net/chrome/notifications.php">my Sandbox</a> to see the code in action, or continue reading for some code excerpts.</p>
<p> <span id="more-365"></span>
<p>One interesting thing about this new API is that it not only requires a user to authorize it, but in order for an authorization click to appear, the user has to do something.&#160; You can’t make it appear as soon as the user visits the page, they have to click something or trigger an event.</p>
<p>For the sake of this example, lets say the user clicks a link that triggers the JavaScript function “notification();” and we want to show a notification onscreen.</p>
<pre><div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> notification<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">webkitNotifications</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// If we have the Notification API</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> nc <span style="color: #339933;">=</span> window.<span style="color: #660066;">webkitNotifications</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Set the API to nc for easy access</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>nc.<span style="color: #660066;">checkPermission</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// 1 = Not Allowed, 2 = Denied, 0 = Allowed</span>
		<span style="color: #009900;">&#123;</span>
			nc.<span style="color: #660066;">requestPermission</span><span style="color: #009900;">&#40;</span>myNotification<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Request Permission with a callback to myNotification();</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> myNotification<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> myNotification<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">try</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> nc <span style="color: #339933;">=</span> window.<span style="color: #660066;">webkitNotifications</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> notif <span style="color: #339933;">=</span> nc.<span style="color: #660066;">createNotification</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;Notification Title&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;Notification Body&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Parameters: string URL_TO_IMAGE, string Title, string Body</span>
		notif.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Show Notification</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>Err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>Err.<span style="color: #660066;">message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Will output a security error if we don't have permission.</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div></pre>
<p>As you can see from the code, its a fairly straightforward API for showing desktop notifications, and once the user has given the website permission, they can be triggered any time.  Up to five notifications can appear, and the rest will be kept in a queue until the others are dismissed, either by the user or by calling .cancel(); on the notification variable (notif in this case).</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2010/01/webkit-javascript-notifications-api.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Never Again (External JavaScript in the Body)</title>
		<link>http://tech.navarr.me/2010/01/never-again-external-javascript-in-the-body.html</link>
		<comments>http://tech.navarr.me/2010/01/never-again-external-javascript-in-the-body.html#comments</comments>
		<pubDate>Wed, 13 Jan 2010 02:55:22 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2010/01/never-again-external-javascript-in-the-body.html</guid>
		<description><![CDATA[This is probably simply a personal taste, but I hate putting External JavaScript tags in the body of a web page.  It feels and looks very unsightly to me.  But as I learn more and more JavaScript, and really start to get a feel for the small language, I’ve realized that I don’t have to.  [...]]]></description>
			<content:encoded><![CDATA[<p>This is probably simply a personal taste, but I hate putting External JavaScript tags in the body of a web page.  It feels and looks very unsightly to me.  But as I learn more and more JavaScript, and really start to get a feel for the small language, I’ve realized that I don’t have to.  That it’d be just as easy to place them directly into the header after the page is ready, by manipulating the DOM.  Here is an excerpt from the beta turled website.</p>
<pre><div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tech.navarr.me/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// Google Analytics</span>
	<span style="color: #003366; font-weight: bold;">var</span> gaJsHost <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;https:&quot;</span> <span style="color: #339933;">==</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">protocol</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;https://ssl.&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	script.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> gaJsHost <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;google-analytics.com/ga.js&quot;</span><span style="color: #339933;">;</span>
	script.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">;</span>
	document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">try</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> pageTracker <span style="color: #339933;">=</span> _gat._getTracker<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;CENSORED&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		pageTracker._trackPageview<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #009966; font-style: italic;">/* Do Nothing. */</span> <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Facebook Share</span>
	<span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	script.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://static.ak.fbcdn.net/connect.php/js/FB.Share&quot;</span><span style="color: #339933;">;</span>
	script.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">;</span>
	document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div></pre>
<p>As you can see, I wait until the document is loaded using jQuery’s ready method, and then create elements for both Google Analytics and Facebook Share, before appending them directly to the &lt;head&gt; of the website.  Keeping the code clean, reducing bandwidth usage for non-JavaScript users, and even making Google’s code cleaner.  (By changing Google Analytic’s default code from document.write to DOM Manipulation.</p>
<p>So, Never again will I feel the need to insert external script tags at the bottom of the &lt;body&gt; just so that the rest of the page loads before them.</p>
<p><strong>Note:</strong> If you’re not using jQuery, document.onload = function() { /* Code */ } works just as well, I promise.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2010/01/never-again-external-javascript-in-the-body.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hunting Down the Bugs &#8211; TwCLI on Chrome for Linux Beta</title>
		<link>http://tech.navarr.me/2009/12/hunting-down-the-bugs-twcli-on-chrome-for-linux-beta.html</link>
		<comments>http://tech.navarr.me/2009/12/hunting-down-the-bugs-twcli-on-chrome-for-linux-beta.html#comments</comments>
		<pubDate>Tue, 15 Dec 2009 18:51:17 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Hunting Down the Bugs]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[TwCLI]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2009/12/hunting-down-the-bugs-twcli-on-chrome-for-linux-beta.html</guid>
		<description><![CDATA[This is the first post of a new series, looking at some of the odder bugs encountered while developing for the expanding Web, no matter how basic a bug it may be. Thanks to twitter user @paperfairy, a bug was discovered on my Command Line Twitter Client, TwCLI. For some reason, when submitting a command [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the first post of a new series, looking at some of the odder bugs encountered while developing for the expanding Web, no matter how basic a bug it may be.</em></p>
<p>Thanks to twitter user @<a href="http://twitter.com/paperfairy" rel="nofollow">paperfairy</a>, a bug was discovered on my Command Line Twitter Client, <a title="Twitter Command Line Interface" href="http://twcli.koneko-chan.net/" rel="me">TwCLI</a>.</p>
<p>For some reason, when submitting a command in Chrome for Linux, the page would simply refresh, and the command would never be sent.&#160; At first, I had no possible way to track down this bug.&#160; I didn’t have a linux box (with a GUI, anyway) so I simply told him that it was unfortunate, but it’d have to stay a bug.&#160; Until a <a href="http://lifehacker.com/5426007/most-popular-free-windows-downloads-of-2009" rel="nofollow">recent post on lifehacker</a> brought my attention to <a href="http://lifehacker.com/5195999/portable-ubuntu-runs-ubuntu-inside-windows">Portable Ubuntu</a>. I immediately installed it, opened up the Chrome website in Firiefox, installed Chrome Beta, and headed over to TwCLI to see what was amiss.</p>
<p>Of course, it was a single line in a detection script to send Geo-Data to Twitter (as long as the user approved it, of course):</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span>(google.gears) {</pre>
<p><!--CRLF--></div>
</div>
<p>This single line was throwing an exception I hadn’t encountered in other browsers – Google wasn’t defined.&#160; Oddly, I thought it would handle that properly, since google wasn’t defined, it would just skip over it, but instead it threw an error and halted all further javascript code.</p>
<p>The fix was simpler than tracking down the bug, I simply had to add this to the start of the javascript code:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">try</span>{ <span style="color: #0000ff">if</span>(!google) { google = 0; } } <span style="color: #0000ff">catch</span>(err) { google = 0; }</pre>
<p><!--CRLF--></div>
</div>
<p>And voila, I had both a check for google, and a catch if it decided to throw errors while checking for it.</p>
<p>Whether this is a Chrome bug or not, I don’t know – I simply don’t know enough about JavaScript in order to say so either way.&#160; But, are undefined variables supposed to throw errors, or are they simply supposed to return false?</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2009/12/hunting-down-the-bugs-twcli-on-chrome-for-linux-beta.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript &amp; CSS3 Lightbox</title>
		<link>http://tech.navarr.me/2009/12/javascrpit-css3-lightbox.html</link>
		<comments>http://tech.navarr.me/2009/12/javascrpit-css3-lightbox.html#comments</comments>
		<pubDate>Sat, 12 Dec 2009 00:33:33 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[CSS3 Lightbox]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2009/12/javascrpit-css3-lightbox.html</guid>
		<description><![CDATA[Usage: Call createLightbox(); to create the actual lightbox element (does not display anything). Call fillLightbox(string content) to fill the lightbox with RAW HTMLor Call appendLightbox(element childElement) to append a DOM Node directly into the lightbox. Call setLightboxSize(int width, int height, null, string unit) to set the width and height of the lightbox.  Unit will default [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><script src="http://gist.github.com/254614.js?file=css3_lightbox.js"></script></p>
<p><strong>Usage</strong>:</p>
<ul>
<li>Call <strong>createLightbox();</strong> to create the actual lightbox element (does not display anything).</li>
<li>Call <strong>fillLightbox(</strong><em>string </em>content<strong>)</strong> to fill the lightbox with RAW HTML<em>or</em>
<p>Call <strong>appendLightbox(</strong><em>element</em> childElement<strong>)</strong> to append a DOM Node directly into the lightbox.</li>
<li>Call <strong>setLightboxSize(</strong><em>int</em> width, <em>int</em> height, <em>null</em>, <em>string</em> unit) to set the width and height of the lightbox.  Unit will default to pixels “px” if not specified.</li>
<li>Call <strong>showLightbox()</strong> to actually display the lightbox to the user.</li>
<li>Call <em>boolean</em> <strong>lightboxVisible()</strong> to determine if the lightbox is still visible or not.</li>
<li>Call <strong>hideLightbox()</strong> to remove the lightbox from view.</li>
<li>Call <strong>cleanLightbox()</strong> to delete all content inside the lightbox container.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2009/12/javascrpit-css3-lightbox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SimpleTwitter Update</title>
		<link>http://tech.navarr.me/2009/10/simpletwitter-update.html</link>
		<comments>http://tech.navarr.me/2009/10/simpletwitter-update.html#comments</comments>
		<pubDate>Fri, 30 Oct 2009 13:28:01 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[SimpleTwitter]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2009/10/simpletwitter-update.html</guid>
		<description><![CDATA[I’ve pushed a simple update to the SimpleTwitter JavaScript.  Change log (if its even needed) below. Support for Twitter Lists Uses the same format as twitter, for example @navarr/shogi Support for Turled Profiles Using the variable &#38;turl=true will link @replies to turled beta-profiles instead of twitter profiles. Surprisingly, this doesn’t break in co-ordination with lists.  [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve pushed a simple update to the <a href="http://tech.gtaero.net/2008/02/javascript-simple-twitter-feed.html">SimpleTwitter</a> JavaScript.  Change log (if its even needed) below.</p>
<ul>
<li>Support for Twitter Lists
<ul>
<li>Uses the same format as twitter, for example @<a href="http://twitter.com/navarr/shogi">navarr/shogi</a></li>
</ul>
</li>
<li>Support for Turled Profiles
<ul>
<li><span style="background-color: #ffffff;">Using the variable &amp;<strong>turl=true</strong> will link @replies to <a href="http://turled.com/beta.php">turled</a> beta-profiles instead of twitter profiles.</span></li>
<li><span style="background-color: #ffffff;">Surprisingly, this doesn’t break in co-ordination with lists.  It just doesn’t display the list.</span></li>
</ul>
</li>
<li><span style="background-color: #ffffff;">Uses Search API</span>
<ul>
<li><span style="background-color: #ffffff;">We moved to the search API for retrieving tweets, as well as pulling a JSON file instead of XML.  This <strong>MAY BREAK</strong> your current implementation (though it should not).  If it does, you can use the older script by pulling <strong>old.php</strong> from the server instead of <strong>index.php</strong></span></li>
</ul>
</li>
</ul>
<p>Yeah, that’s it.  Was thinking about making the default for &amp;turl being true instead of false, but figured that’d probably annoy more people than it was worth (at least until I get turled to be of more use as a twitter replacement).</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2009/10/simpletwitter-update.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>YouTube Mini Audio Player</title>
		<link>http://tech.navarr.me/2009/10/youtube-mini-audio-player.html</link>
		<comments>http://tech.navarr.me/2009/10/youtube-mini-audio-player.html#comments</comments>
		<pubDate>Tue, 27 Oct 2009 23:34:56 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[YouTube]]></category>
		<category><![CDATA[YouTube Audio Player]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2009/10/youtube-mini-audio-player.html</guid>
		<description><![CDATA[If you read my personal blog (which a lot of you probably don’t even know exists) you’ll commonly see music embedded as mini-YouTube embeds.&#160; It turns out, the magic height is 25 pixels, and the magic width (for play/pause and mute) is 62 pixels. However, it is kind of a burden to do this every [...]]]></description>
			<content:encoded><![CDATA[<p>If you read my personal blog (which a lot of you probably don’t even know exists) you’ll commonly see music embedded as mini-YouTube embeds.&#160; It turns out, the magic height is 25 pixels, and the magic width (for play/pause and mute) is 62 pixels.</p>
<div style="padding-bottom: 0px; margin: 0px auto; padding-left: 0px; width: 62px; padding-right: 0px; display: block; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:483cec9e-036b-43a9-b49a-eb9506b37975" class="wlWriterEditableSmartContent">
<div><object width="62" height="25"><param name="movie" value="http://www.youtube-nocookie.com/v/4pXfHLUlZf4&amp;hl=en&amp;fs=1&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/4pXfHLUlZf4&amp;hl=en&amp;fs=1&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="62" height="25"><a href="http://www.youtube.com/watch?v=4pXfHLUlZf4"><span style='text-align:left;display:block;'><p><object type='application/x-shockwave-flash' data='http://s2.wp.com/wp-content/plugins/audio-player/player.swf' width='290' height='24' id='audioplayer1'><param name='movie' value='http://s2.wp.com/wp-content/plugins/audio-player/player.swf' /><param name='FlashVars' value='&amp;bg=0xf8f8f8&amp;leftbg=0xeeeeee&amp;lefticon=0x666666&amp;rightbg=0xcccccc&amp;rightbghover=0x999999&amp;righticon=0x666666&amp;righticonhover=0xffffff&amp;text=0x666666&amp;slider=0x666666&amp;track=0xFFFFFF&amp;border=0x666666&amp;loader=0x9FFFB8&amp;soundFile=on%20youtube' /><param name='quality' value='high' /><param name='menu' value='false' /><param name='bgcolor' value='#FFFFFF' /><param name='wmode' value='opaque' /></object></p></span></a></embed></object></div>
</div>
<p>However, it is kind of a burden to do this every time you want to embed a mini player (you have to edit at four fields in the HTML!)&#160; So to simplify this process, I, like any programmer before me, <a href="http://www.gtaero.net/ytmusic/">created a generator</a>.&#160; Just type in the URL to the YouTube video and press make, and you’ll get a preview as well as the cross-browser HTML-esque mess of a code to embed.</p>
<p>Of course, if you’re <strong>truly</strong> lazy, just drag the bookmarklet below to your bookmark bar in your web browser, and click it on any YouTube video and you’ll be taken to the page with the code already generated.</p>
<p align="center"><a href="javascript:document.location='http://gtaero.net/ytmusic/?q=' + document.location">Generate Mini-Player</a></p>
<p align="left">Source code is available via link at the bottom of the page.</p>
<p align="left"><a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="80x15[1]" border="0" alt="80x15[1]" src="http://tech.gtaero.net/wp-content/uploads/2009/10/80x151.png" width="80" height="15" /></a> </p>
<div style="display: none"><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">class::Scrobbler</span> by <a href="http://www.koneko-chan.net/people/Navarr" rel="cc:attributionURL" property="cc:attributionName" xmlns:cc="http://creativecommons.org/ns#">Navarr T. Barnier</a> is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>.     <br />Based on a work at <a href="http://www.gtaero.net/ytmusic/?source" rel="dc:source" xmlns:dc="http://purl.org/dc/elements/1.1/">gtaero.net</a>.     <br />Permissions beyond the scope of this license may be available at <a href="mailto:navarr@koneko-chan.net" rel="cc:morePermissions" xmlns:cc="http://creativecommons.org/ns#">mailto:navarr@koneko-chan.net</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2009/10/youtube-mini-audio-player.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

