<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Kris "Justise" Gray</title>
	
	<link>http://www.justise.com</link>
	<description>Programming - Development</description>
	<pubDate>Thu, 29 Jan 2009 22:17:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/BlackBeltCoder" type="application/rss+xml" /><item>
		<title>Format strings with Mootools</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/YcX2dqWe_a8/</link>
		<comments>http://www.justise.com/2009/01/29/format-strings-with-mootools/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 22:17:11 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.justise.com/?p=275</guid>
		<description><![CDATA[Remember String.Supplant()?
Its the nifty little tool that lets you do this.
PLAIN TEXT
JavaScript:




"The date today is {todayDate}, thank you {name}".supplant&#40;


&#160; &#123; "todayDate" : new Date&#40;&#41;.toString&#40;&#41;, "name" : "Clark Kent" &#125;


&#41;; 






Normally you would need to include the prototype supplied by Douglas Crockford on the page for you to be able to use this, but if you [...]]]></description>
			<content:encoded><![CDATA[<p>Remember <a href="http://www.justise.com/2007/12/28/stringsupplant-a-jewel-from-douglas-crockford/" >String.Supplant()</a>?</p>
<p>Its the nifty little tool that lets you do this.</p>
<div class="igBar"><span id="ljavascript-3"><a href="#" onclick="javascript:showPlainTxt('javascript-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-3">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">"The date today is {todayDate}, thank you {name}"</span>.<span style="color: #006600;">supplant</span><span style="color: #66cc66;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#123;</span> <span style="color: #3366CC;">"todayDate"</span> : <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #3366CC;">"name"</span> : <span style="color: #3366CC;">"Clark Kent"</span> <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Normally you would need to include the prototype supplied by <a href="http://www.crockford.com/" onclick="javascript:urchinTracker ('/outbound/article/www.crockford.com');">Douglas Crockford</a> on the page for you to be able to use this, but if you are using the <a href="http://www.mootools.net/" onclick="javascript:urchinTracker ('/outbound/article/www.mootools.net');">Mootools library</a> then its already built in. </p>
<p><a href="http://mootools.net/docs/Native/String#String:substitute" onclick="javascript:urchinTracker ('/outbound/article/mootools.net');">String Method: Substitute</a></p>
<div class="igBar"><span id="ljavascript-4"><a href="#" onclick="javascript:showPlainTxt('javascript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-4">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myString = <span style="color: #3366CC;">"{subject} is {property_1} and {property_2}."</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myObject = <span style="color: #66cc66;">&#123;</span>subject: <span style="color: #3366CC;">'Jack Bauer'</span>, property_1: <span style="color: #3366CC;">'our lord'</span>, property_2: <span style="color: #3366CC;">'savior'</span><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myString.<span style="color: #006600;">substitute</span><span style="color: #66cc66;">&#40;</span>myObject<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">//Jack Bauer is our lord and savior </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2009/01/29/format-strings-with-mootools/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2009/01/29/format-strings-with-mootools/</feedburner:origLink></item>
		<item>
		<title>Enabling the Back Button in Ajax Applications</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/6Xr9NPBK9E8/</link>
		<comments>http://www.justise.com/2009/01/26/enabling-the-back-button-in-ajax-applications/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 23:39:27 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.justise.com/?p=247</guid>
		<description><![CDATA[Overview
Enabling the back button isn't quite as difficult as it might sound, especially for a project that your starting from scratch. Here's a simple example and then we'll go through the techniques needed to make this happen.
Change Background Color To

Denim
Maroon
Black


If this is not working for you, then you can try this test page.
As you click [...]]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>Enabling the back button isn't quite as difficult as it might sound, especially for a project that your starting from scratch. Here's a simple example and then we'll go through the techniques needed to make this happen.</p>
<h4>Change Background Color To</h4>
<ul class="button-list">
<li><a class="post-internal" rel="465e77" href="/denim/index.php?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac">Denim</a></li>
<li><a class="post-internal" rel="990000" href="/maroon/index.php?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac">Maroon</a></li>
<li><a class="post-internal" rel="000000" href="/black/index.php?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac">Black</a></li>
</ul>
<p><script src="http://www.justise.com/wp-content/themes/justise/js/rsh/rsh.compressed.js"></script><script src="/prototype/blog/rsh.sample.js"></script></p>
<p>If this is not working for you, then you can try <a href="http://justise.com/prototype/blog/backbutton.html" >this test page</a>.</p>
<p>As you click the different buttons, you should notice the URL of this page is changing. The key is this portion below.</p>
<p><code class="callout">#change-background:990000</code></p>
<p>When we change the hash of the page, we aren't requesting a new page from the server, the browser thinks we are navigating to a new portion of the page. (Some people know that if there was an ID of change-background:990000 on the page, the browser would attempt to focus on that element) Because of this, it creates a history entry that we can use to track back button usage, and deep linking. </p>
<h3>Note on browser inconsistencies</h3>
<p>Now obviously not all browsers handle this the same way, thus we use a library which abstracts all these problems away from you and lets you only worry about your application. The library we are using here is <a href="http://code.google.com/p/reallysimplehistory/" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">RSH (Really Simple History)</a>. Here are a few other libraries you could use.</p>
<ul>
<li><a href="http://www.asual.com/swfaddress/" onclick="javascript:urchinTracker ('/outbound/article/www.asual.com');">SWFAddress</a></li>
<li><a href="http://plugins.jquery.com/project/historyevent" onclick="javascript:urchinTracker ('/outbound/article/plugins.jquery.com');">History Event: jQuery Plugin </a></li>
<li><a href="http://digitarald.de/project/history-manager/" onclick="javascript:urchinTracker ('/outbound/article/digitarald.de');">HistoryManager: Mootools Plugin</a></li>
</ul>
<h3>Code</h3>
<p>Lets look at the code necessary to implement this feature.</p>
<div class="igBar"><span id="lhtml-10"><a href="#" onclick="javascript:showPlainTxt('html-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-10">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/h4.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;h4&gt;</span></a></span>Change Background Color To<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h4&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/ul.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;ul</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"button-list"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/li.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;li&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"post-internal"</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">"465e77"</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"/denim/index.php"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Denim<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/li.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;li&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"post-internal"</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">"990000"</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"/maroon/index.php"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Maroon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/li.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;li&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html" onclick="javascript:urchinTracker ('/outbound/article/december.com');"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"post-internal"</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">"000000"</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"/black/index.php"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Black<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This is the HTML for the 3 buttons, some of the important things to note here.</p>
<ul>
<li>I tagged each button with a "post-internal" class. This allows me to create a generic function that attaches the history logic.</li>
<li>I attached the history information to the element. I typically use the rel to attach information to elements, I don't know why, its just the way its always been done.</li>
<li>I've added an href, so if the user doesn't have Javascript enabled, they could navigate to the separate index pages in the color directories which would know they need to color the page. This is certainly overkill for a background color change, but its one of the important aspects of unobtrusive Javascript.</li>
</ul>
<p>Obviously the heavy lifting is in the Javascript.</p>
<div class="igBar"><span id="ljavascript-11"><a href="#" onclick="javascript:showPlainTxt('javascript-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-11">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; toJSON: JSON.<span style="color: #006600;">encode</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fromJSON: JSON.<span style="color: #006600;">decode</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #006600;">addEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"load"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>$listener<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">".post-internal"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"click"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>ev<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"change-background:"</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"rel"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- Event Code</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; changeBgColor<span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"rel"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- Don't go to the HREF address.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>ev<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> $listener<span style="color: #66cc66;">&#40;</span>newLocation, historyData<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- If not the url event we are looking for, escape.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>newLocation.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"change-background:"</span><span style="color: #66cc66;">&#41;</span> == -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- Set the background of our HTML element to the color specified in the URL.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; changeBgColor<span style="color: #66cc66;">&#40;</span>newLocation.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"change-background:"</span>, <span style="color: #3366CC;">""</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> changeBgColor<span style="color: #66cc66;">&#40;</span>newBgColor<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">body</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"background"</span>, <span style="color: #3366CC;">"#"</span> + newBgColor<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This is the entire contents of my sample script file, so we'll go down through each section.</p>
<div class="igBar"><span id="ljavascript-12"><a href="#" onclick="javascript:showPlainTxt('javascript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-12">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; toJSON: JSON.<span style="color: #006600;">encode</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fromJSON: JSON.<span style="color: #006600;">decode</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>RSH creates itself in the property <code>window.dhtmlHistory</code>, so thats already going to be there for you. RSH uses some JSON to track its history data, so you'll need to supply it some methods for serializing and de-serializing. It does come with these methods in a separate file, but since Mootools already includes these, I just used the ones from Moo. </p>
<p>This you can go ahead and do outside of any events.</p>
<div class="igBar"><span id="ljavascript-13"><a href="#" onclick="javascript:showPlainTxt('javascript-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-13">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #006600;">addEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"load"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>$listener<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">".post-internal"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"click"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>ev<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; window.<span style="color: #006600;">dhtmlHistory</span>.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"change-background:"</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"rel"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- Event Code</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; changeBgColor<span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"rel"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- Don't go to the HREF address.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>ev<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A bunch of stuff here, we attach our initialization logic to the window load event as RSH explicitly states </p>
<blockquote><p>
RSH will break, especially in IE, if you try to initialize it from any flavor of DOMContentLoaded.
</p></blockquote>
<p>Once in the loaded event, we call initialize to start the process, and then we add our listener. This listener function is what will get called every time someone hits the back button, forward button, or even the page being loaded with a hash value. </p>
<p>Inside the onload event, we add our onclick event for the buttons.</p>
<p>When the button is clicked, we use the add() method of RSH to add a new history entry. While the listener method is probably 40% of the logic you will need to provide to implement history tracking, this single call is the other 40%. Really those two features make up the meat of it. </p>
<p>The value we pass to the add needs to be descriptive enough that we can figure out what to do with the information in our listener event. In my example, I'm appending "change-background:" to the hash code, so when my listener fires, I know that it has the information I want (someone else isn't doing some other history tracking) and that I know what to change the background to.</p>
<p>Now when you add a history entry, RSH does <strong>NOT</strong> fire the history change event listener. (It really should, more later) So you need to also attach your logic for the event as well, which is a simple changeBgColor method with the rel information of the clicked on link.</p>
<p>Lastly, we don't want to actually go to the URL specified in the anchor tag so we use preventDefault() to cancel that.</p>
<div class="igBar"><span id="ljavascript-14"><a href="#" onclick="javascript:showPlainTxt('javascript-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-14">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> $listener<span style="color: #66cc66;">&#40;</span>newLocation, historyData<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- If not the url event we are looking for, escape.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>newLocation.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"change-background:"</span><span style="color: #66cc66;">&#41;</span> == -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//--- Set the background of our HTML element to the color specified in the URL.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; changeBgColor<span style="color: #66cc66;">&#40;</span>newLocation.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"change-background:"</span>, <span style="color: #3366CC;">""</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This is our event that gets fired every time the history changes. When our listener here gets fired, it looks to see if any change-background information is in the URL, and then it parses out the hex value and calls the changeBgColor method. </p>
<p>With this method, you'll want to start thinking of the URL as a full description of the state of your application. The less you track in your URL, the less the user can bookmark to, and the less they can back button out of. The extent to which you implement this is totally up to you, and admittedly this could make your URL quite complex...</p>
<h3>Gripes about RSH</h3>
<p>I wanted to use RSH because its had quite a bit of development on it, so I assumed it would be a solid bug free library. Plus it has one purpose, Ajax applications history tracking, unlike SWFAddress which has some integration with Flash and thus feels like using the wrong tool for the job sometimes.</p>
<p>Though I have a big problem with it not firing the listener event when we use the add() method. Since we put all the information in the URL, and we have to write the listener method to parse that information and set the page to that state, there's no reason to put that logic anywhere else. Be aware you won't always have to duplicate your code like this in the other libraries, SWFAddress specifically.</p>
<h3>One last note about Deep linking</h3>
<p>When you implement the back button, you get deep linking for free. I know, you rarely get things solved for free, but since we are using the URL to describe the state of our application, when the page loads up RSH will fire off our listener event notifying us theres some information in the hash. From there, our application doesn't care how that information go there, its just going to operate on it. </p>
<h3>Download Sample Code</h3>
<p><a href="http://justise.com/prototype/blog/Justise-BackButton.zip" >Justise-BackButton.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2009/01/26/enabling-the-back-button-in-ajax-applications/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2009/01/26/enabling-the-back-button-in-ajax-applications/</feedburner:origLink></item>
		<item>
		<title>Project Retrospective Demeter Group</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/SnnuHBx-mM8/</link>
		<comments>http://www.justise.com/2009/01/16/project-retrospective-demeter-group/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 19:20:44 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[Retrospective]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=213</guid>
		<description><![CDATA[
This is the first version of the Demeter Group website, it's a flat HTML site with no CMS and has some usage of JavaScript to allow for in page browsing.
Some notes from this project.

Working with people who you recognize is lots of fun. These guys actually worked with Method the soap company; GU2O is a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.demetergroup.net/" onclick="javascript:urchinTracker ('/outbound/article/www.demetergroup.net');"><img class="alignnone size-medium wp-image-214" title="Demeter Group Website" src="http://blackbeltcoder.net/wp-content/uploads/2009/01/demetergroup-470x359.png" alt="Demeter Group Website" width="470" height="359" /></a></p>
<p>This is the first version of the Demeter Group website, it's a flat HTML site with no CMS and has some usage of JavaScript to allow for in page browsing.</p>
<p>Some notes from this project.</p>
<ul>
<li>Working with people who you recognize is lots of fun. These guys actually worked with <a href="http://www.methodhome.com/" onclick="javascript:urchinTracker ('/outbound/article/www.methodhome.com');">Method the soap company</a>; GU2O is a product I've used in the past during my runs; and I keep seeing their products at various stores which gives me a sense of pride that in some small (very very small) way I contributed to the success of that product.</li>
<li>I experimented with another layout for my JavaScript. I'm trying to find the right type of techniques for each different size of website; in this one I did a new class for each page, and since some of the pages were similar, I utilized a base class for those.</li>
<li>On this project, I estimated about a day for the back button implementation as the last time I did it on Method.com it took forever. When it came time to implement it, it took about 2 hours. Now I've done it so many times, 30 minutes is enough time.</li>
<li>Getting a new designer in the middle of the project sucks. Unfortunately the designer who created the design moved back to Seattle right before I started coding, so a new designer had to pick up where he left off. This wasn't fun for either of us as its hard for another designer to answer to the original designers intent.</li>
<li>In JS Libraries like M and jQuery, you should use lowercase in your CSS selector searches. WebKit based browsers (Safari, Chrome) don't like the uppercase tag names. I really haven't investigated it, but I would assume the tag names are in lower-case and the libraries tend to use methods that do css searches that care about such things. (querySelectorAll, querySelector).</li>
</ul>
<div class="igBar"><span id="ljavascript-16"><a href="#" onclick="javascript:showPlainTxt('javascript-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-16">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//--- Safari doesn't like this</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"BODY"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">".."</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//--- It prefers this</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"body"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">".."</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<ul>
<li>Make sure you cancel your animations for mouse-over events if the user navigates to another element with an animation.</li>
<li>Content is the hardest part of any project. Its hard to create, hard to plan for without, and rarely fits at the end.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2009/01/16/project-retrospective-demeter-group/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2009/01/16/project-retrospective-demeter-group/</feedburner:origLink></item>
		<item>
		<title>Biggest problem with reset stylesheets? List style type inheritance.</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/k1Y_YcEc1Fw/</link>
		<comments>http://www.justise.com/2009/01/13/biggest-problem-with-reset-stylesheets-list-style-type-inheritance/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 00:34:40 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=205</guid>
		<description><![CDATA[Lately I've been running into issues using the Yahoo Reset CSS file.  Typically we can account for every situation when developing our templates to be handed off to the client, and so anything the reset stylesheet removes, we can just add back. But it turns out thats not true. 
For our latest project, we did templates [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I've been running into issues using the Yahoo Reset CSS file.  Typically we can account for every situation when developing our templates to be handed off to the client, and so anything the reset stylesheet removes, we can just add back. But it turns out thats not true. </p>
<p>For our latest project, we did templates for the<a href="http://www.javafx.com/" onclick="javascript:urchinTracker ('/outbound/article/www.javafx.com');"> Sun JavaFX website</a>. One of the more common things they are doing over there is posting JavaFX samples and tutorials on how to program with the new framework. In so doing, they ended up doing quite a bit of lists and sub-lists. We all expected this not to be a problem, but when it came time to input the content we found the reset stylesheet was a little two agressive. </p>
<p>Here is what you would expect a normal list with some sub-lists inside of it to look like.</p>
<p><img class="alignnone size-full wp-image-206" title="expected" src="http://blackbeltcoder.net/wp-content/uploads/2009/01/expected.png" alt="expected" width="203" height="413" /></p>
<p>Now after we've applied the following CSS ripped right from the Yahoo Reset css file, we will have killed all the bullets and numbers.</p>
<div class="igBar"><span id="lcss-23"><a href="#" onclick="javascript:showPlainTxt('css-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-23">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">li<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">list-style</span>:<span style="color: #993333;">none</span>;<span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><img class="alignnone size-full wp-image-207" title="Lists and Sub Lists with No Bullets" src="http://blackbeltcoder.net/wp-content/uploads/2009/01/no-bullets.png" alt="Lists and Sub Lists with No Bullets" width="209" height="420" /></p>
<p>From here, everything seems kosher, except that we now need to add some bullets and numbers back in. From here it gets hairy. </p>
<p>For all browsers except the one you love to hate (IE 6 -8) you can do this.</p>
<div class="igBar"><span id="lcss-24"><a href="#" onclick="javascript:showPlainTxt('css-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-24">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">li<span style="color: #66cc66;">&#123;</span>  <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">inherit</span>; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>That will bring back the browser based list style inheritance.  Yet for IE, this doesn't work, you get no bullets/numbers at all. Certainly annoying, but we have to work past this, so lets think about a solution.</p>
<div class="igBar"><span id="lcss-25"><a href="#" onclick="javascript:showPlainTxt('css-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-25">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ul li <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">disc</span>; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ol li <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">decimal</span>; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Then we have to account for UL's inside UL's being different and UL's inside UL's inside UL's... yea...</p>
<p> </p>
<div class="igBar"><span id="lcss-26"><a href="#" onclick="javascript:showPlainTxt('css-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-26">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ul li <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">disc</span>; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ul li ul li <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">circle</span>; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ul li ul li ul li<span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">square</span>; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ol li <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">decimal</span>; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div>This will result in the following styles.</div>
<div></div>
<div><img class="alignnone size-full wp-image-208" title="fail1" src="http://blackbeltcoder.net/wp-content/uploads/2009/01/fail1.png" alt="fail1" width="210" height="413" /></div>
<div>Yea we didn't account for OL's inside UL's. To think about it we didn't account for UL's inside OL's either. The combinations here are pretty extensive.  You'll basically need a new set for each level deeper you go.</div>
<div></div>
<div>We can't just do</div>
<p> </p>
<div class="igBar"><span id="lcss-27"><a href="#" onclick="javascript:showPlainTxt('css-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-27">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">UL UL UL OL LI <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">decimal</span>; <span style="color: #66cc66;">&#125;</span>  </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>because what if the content developer needs to add another UL list? Sigh. </p>
<p>So recently I've been either deleting this statement from the Reset CSS file, or having a special class applied to the bullet type you want, and then you just apply that to the list. This irks me in many ways, but IE tends to do that to me.</p>
<div class="igBar"><span id="lcss-28"><a href="#" onclick="javascript:showPlainTxt('css-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-28">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ol<span style="color: #6666ff;">.bullet </span>li, ul<span style="color: #6666ff;">.bullet </span>li<span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style-type</span>: bullet; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2009/01/13/biggest-problem-with-reset-stylesheets-list-style-type-inheritance/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2009/01/13/biggest-problem-with-reset-stylesheets-list-style-type-inheritance/</feedburner:origLink></item>
		<item>
		<title>The Ajax Experience: The Rest</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/6J5A4cZWZgA/</link>
		<comments>http://www.justise.com/2008/10/15/the-ajax-experience-the-rest/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 17:58:32 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[the ajax experience]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=188</guid>
		<description><![CDATA[
Day 2 was easily the most information packed and exciting of the 3 days.
IE8 was a Sponsor this year, yet their involvement was still quite small in the conference. They did have several speakers, but you can tell the conference is still being driven by the Sitepen (Dojo), Google (GWT, Chrome) and Mozilla (jQuery, etc) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blackbeltcoder.net/wp-content/uploads/2008/10/img_0187.jpg" onclick="javascript:urchinTracker ('/outbound/article/blackbeltcoder.net');"><img class="alignnone size-medium wp-image-193" title="img_0187" src="http://blackbeltcoder.net/wp-content/uploads/2008/10/img_0187-470x352.jpg" alt="" width="470" height="352" /></a></p>
<p>Day 2 was easily the most information packed and exciting of the 3 days.</p>
<p>IE8 was a Sponsor this year, yet their involvement was still quite small in the conference. They did have several speakers, but you can tell the conference is still being driven by the Sitepen (Dojo), Google (GWT, Chrome) and Mozilla (jQuery, etc) groups.</p>
<p><strong>Faster then Light JavaScript</strong></p>
<p>The opening talk was from Brendan Eich. Brendan is in a strange situation where is his the master and overlord of JavaScript, yet you can tell he's a bit more intellectual then the typical JavaScript guru. He focuses a lot about lower language constructs and less about closures and the like, which is just kind of weird.</p>
<p> </p>
<ul>
<li>Tracemonkey
<ul>
<li>Incrementally Rewritten to be much faster</li>
<li>Now fast as almost anything.</li>
</ul>
</li>
<li>V8, SpiderMonkey
<ul>
<li>Both are very fast and really good codebases.</li>
<li>Getting Close to C Speed</li>
</ul>
</li>
<li>IE
<ul>
<li>Seaworthy (Showed picture of a beaten down houseboat)</li>
<li>Kind of missing in the JavaScript performance arena. </li>
</ul>
</li>
<li>Whats it all mean?
<ul>
<li>Browsers get near native JS Performance</li>
<li>Mobile browsers too, without sucking massive amounts of power</li>
<li>IE being guilted/pressured into getting better</li>
<li>Developers make your voices heard!</li>
</ul>
</li>
<li>Canvas
<ul>
<li>Actual image processing capable</li>
<li>Ray Tracking Possible now, will be 3-4 times faster in 1 year</li>
<li>HTML5 Web Worker threads</li>
</ul>
</li>
<li>On the Horizon
<ul>
<li>CSS Transformations</li>
<li>CSS3 Selectors</li>
<li>Border image</li>
</ul>
</li>
<li>Trying to put SVG Back into the web (Though John Resig already voiced his doubts that without a hail mary miracle that SVG is pretty much a goner)</li>
</ul>
<div><strong>Analyzing Ajax Perf with IE8</strong></div>
<div>I was very suprised that this was a Microsoft IE8 talk. It focused mainly on the new IE8 tools and how to use them to profile Ajax Applications.</div>
<div>
<ul>
<li>Javascript Profiler in IE8! (Bet ya didn't know that was coming)
<ul>
<li>Has an IE7 and IE8 Mode</li>
<li>Has an API with documentation on MSDN.</li>
</ul>
</li>
<li><a href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">Native JSON Support</a>
<ul>
<li>Global JSON object with methods to serialize and deserialize objects to and from JSON.</li>
<li>Great gains in performance with this object, 10x gain in Serialization, 3x gain in Parsing.</li>
</ul>
</li>
<li>IE also has a good Script debugger with the profiler, which of course is 8 years late.</li>
<li><a href="http://blogs.msdn.com/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">Check out more at the IEBlog</a></li>
</ul>
<div><strong>The Lightning Rounds</strong></div>
<div>They had this new session setup this year where they have 10 different speakers with 5 minutes each. This was wonderfull, I wish they could do this for all of the sessions of the day so you can get a quick peek on whats going on.</div>
<div>
<ul>
<li><a href="http://www.smushit.com/" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/www.smushit.com');">Smushit.com</a> - This tool will use different algorithims to shrink all the images on your site and tell you how much you could be saving with its version of your images instead. Awesome tool.</li>
<li>Dreamweaver - CS4 presentation, now has some serious JS abilities including native intellisense as well as third party library intellisense. </li>
<li>Hacking Netflix - Bill Scott announced a<a href="http://developer.netflix.com/" onclick="javascript:urchinTracker ('/outbound/article/developer.netflix.com');"> new API</a> for Netflix. He also showed off the <a href="http://blog.netflix.com/" onclick="javascript:urchinTracker ('/outbound/article/blog.netflix.com');">Netflix blog</a> which I've always been curious if they had one.</li>
<li>Interviewing JS Guru's - He shows them code and asks them whats wrong with it. Really loves when the people see the XSS issue. Says finding developers with the never good enough Attitute is crucial. Also would like people to know about DNS, Page Caching, how CGI Works.</li>
</ul>
</div>
<div><strong>JSON SOA-Based Client/Server Application Development </strong><strong><a href="http://ajaxexperience.techtarget.com/assets/documents/Kris_Zyp_JSON_SOA-based_ClientServer.pdf"title="Talk Slides"  target="_blank" onclick="javascript:urchinTracker ('/outbound/article/ajaxexperience.techtarget.com');">(slides)</a></strong></div>
<div>A class based on Dojo communicating with the server REST style.</div>
<div>
<ul>
<li>Dojo now has SMD's (Simple Method Description - WSDL in JSON kinda) for Popular API's. Allows you to instantiate an object with a supplied SMD and call methods on that remote service all from within Dojo. </li>
<li>Full Rest Capabilities in Dojo for contacting these services</li>
<li>Dojo Secure
<ul>
<li>Framework for bringing together different services in a mashup</li>
<li>Adsafe</li>
<li>Not done yet, lots of work being put into this area of dojo.</li>
</ul>
</li>
<li>No Premature Standardization
<ul>
<li>They don't want innovation to be slowed by standards at this point.</li>
</ul>
</li>
</ul>
<div>This was a really content filled talk with many different areas being focused on, I ended up paying a lot of attention, understanding only half and getting notes on a quarter. </div>
<div><strong>State of the Browsers <a href="http://www.quirksmode.org/blog/archives/2008/10/the_ajax_experi_1.html" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/www.quirksmode.org');">(slides available here)</a></strong></div>
<div>PPK gave a talk about where we are with the browsers that was 70% relaxing, 30% informative. He started off going into the history of the browser wars, and then the maturation of the browsers through the years. </div>
<div>
<ul>
<li>NN4 and IE4 led to the browser wars of 96-99.
<ul>
<li>Divided the world, basicly you choose a browser and that was what you used. Now adays you choose a browser based mostly on the User Experience, but back then you choose it based on the features.</li>
<li>Deliberately incompatible. They wanted you to choose their browser because it had feature X and the other browser didn't.
<ul>
<li>PPK said this didn't work, I think he was refering to the fact that it didn't work for us web developers, but it certainly worked for IE. </li>
</ul>
</li>
</ul>
</li>
<li>These incompatibilities really hurt because if a site didn't work, then it was the site owners fault. Even though the browsers made it so hard for site owners to get them to work in all browsers.</li>
<li>Ideology
<ul>
<li>MIcrosoft is EVIL!
<ul>
<li>Why? Just because. They built the better browser, they deserved to win.</li>
</ul>
</li>
<li>Worst part of the browser wars.</li>
</ul>
</li>
<li>IE Did deserve to win
<ul>
<li>IE 5 was a great browser, it had XMLHTTP.</li>
<li>Says nobody was using it at the time, though he wasn't aware of the project I was on in 2000. <img src='http://www.justise.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>IE5 Mac did for CSS what IE5 Win did for Ajax, it really brought it to the forefront and showed it as a viable technology.</li>
</ul>
</li>
<li>Browser Peace
<ul>
<li>Microsoft became complacent.
<ul>
<li>Quiet for 6 years!</li>
</ul>
</li>
<li>Allowed other browsers to catch up
<ul>
<li>Firefox now 20-25%!</li>
</ul>
</li>
</ul>
</li>
</ul>
<div>Here we got into some areas of the browsers  that are still really painfull.</div>
</div>
<div>
<ul>
<li>Adding rules to Stylesheets
<ul>
<li>insertRule() for all but IE</li>
<li>add() for IE</li>
</ul>
</li>
<li>Event Model
<ul>
<li>I'm sure you know about this already.</li>
</ul>
</li>
<li>Ranges
<ul>
<li>Start / End container works in all but IE</li>
<li>Not possible in IE</li>
</ul>
</li>
<li>Extensions
<ul>
<li>99% of the extensions out there really suck</li>
<li>1% are brilliant
<ul>
<li>:hover</li>
<li>innerHTML</li>
</ul>
</li>
</ul>
</li>
<li>Empty text nodes
<ul>
<li>We don't need to iterate over empty text notes. Sucko!</li>
<li>Yet IE will sometimes display white space in the browser, so...</li>
</ul>
</li>
<li>mouseenter/mouseleave
<ul>
<li>IE only extension</li>
<li>Great extension. The fact that all the JS libraries are including an implementation of it should tell the other browser manufacturers that we need this.</li>
<li>Not part of the standard, so not implemented.</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<p>I'm trying to get this out the door, so here's some notes from the rest of the conference, very much abbreviated.</p>
<p> </p>
<ul>
<li>YUI Test was showcased. <a href="http://developer.yahoo.com/yui/yuitest/" onclick="javascript:urchinTracker ('/outbound/article/developer.yahoo.com');">Check out more here.</a>
<ul>
<li>Still looks a little more complicated then it should be.</li>
<li>I think John Resig mentioned a testing framework as a Firebug plugin. That sees like the way it should be.</li>
</ul>
</li>
<li>Someone was using the tool <a href="http://www.pnotepad.org/" onclick="javascript:urchinTracker ('/outbound/article/www.pnotepad.org');">Programmers Notepad</a>, which seemed cool so I made a note of it.</li>
<li>UX Design for Ajax Apps
<ul>
<li>Design is how things work.</li>
<li><a href="http://www.amazon.com/Design-Everyday-Things-Donald-Norman/dp/0385267746" onclick="javascript:urchinTracker ('/outbound/article/www.amazon.com');">The Design of Everyday Things</a> (Recommended Book)</li>
<li>Instructions don't make things usable. </li>
<li>Must do Research to determine usability.
<ul>
<li>Don't ask customers what they want, find out what they do.</li>
</ul>
</li>
<li><a href="http://www.amazon.com/Universal-Principles-Design-William-Lidwell/dp/1592530079" onclick="javascript:urchinTracker ('/outbound/article/www.amazon.com');">Universal Principles of Design</a> (Another Highly Recommended Book)</li>
<li>Tool: <a href="http://kuler.adobe.com/" onclick="javascript:urchinTracker ('/outbound/article/kuler.adobe.com');">Kuler</a> - Generates color palletes</li>
<li>Don't Pretend
<ul>
<li>Pretending to be the user means your pretending to be stupid, which just isn't possible. Clients aren't stupid in general, just when dealing with whatever you happen to develop/design.</li>
<li>Pretend instead to be the application.</li>
</ul>
</li>
</ul>
</li>
<li>Performance from Yahoo
<ul>
<li>Amazon did a test and added a 100ms delay to the loading of their site. They experienced a 1% drop in sales as a result.</li>
<li>Yahoo did another test, adding 400ms to their load time, they recieved 5-9% drop in full page traffic.</li>
<li>Google, same thing, +500ms to their load time, 20% fewer searches.</li>
<li>Get YSLOW! It was an overarching theme of the session.</li>
<li>Flush the buffer early if you can, gets the browser working while the server does the rest of its work.</li>
<li>Use GET for Ajax requests.
<ul>
<li>Only 1 TCP packet is sent with GET</li>
<li>Post sends a headers, and posts body seperately and has a lot more content.</li>
</ul>
</li>
<li>Post-load components
<ul>
<li>Whats absolutely necessary to render the page?</li>
<li>User percieves site is loaded after site looks visiually loaded. </li>
<li>JS can load in after site looks visually complete.</li>
</ul>
</li>
<li>Pre-load components (3 Different types)
<ul>
<li>Unconditional: Google preloads its results images on the google search page.</li>
<li>Conditional: On search typing, start preload of images.</li>
<li>Anticipated: Anticipating new release? Start pushing out those images for the next release early so the users cache isn't completely empty.</li>
</ul>
</li>
<li>Avoid Filters (AlphaImageLoader)
<ul>
<li>Blocks Rendering of the page.</li>
<li>Increases memory consumption</li>
<li>New filter per usage, not per page.</li>
<li>Avoid completely if you can.</li>
</ul>
<ul>
<li>Use PNG8, works just fine, no grey background, but boolean transparency only.</li>
</ul>
</li>
<li>PNG8 Does support alphatransparency, and in IE8 the alpha-transparent bits will show as completely transparent. Didn't understand how to get this to work though, they were vague on it.</li>
<li>IPhone
<ul>
<li>Total Cache 1024k</li>
<li>25kb limit on a single file no longer exists.</li>
</ul>
</li>
<li>Look out for your users (Don't hurt your users speed)</li>
<li>Harvest low hanging fruit</li>
<li>Balance features with speed
<ul>
<li>They explained this as, balance the perf budget.</li>
</ul>
</li>
<li>Verify Assumptions!</li>
<li>Make Perf part of your process.</li>
<li>Measure and track results
<ul>
<li>Firebug</li>
<li>IBM Page Detailer</li>
<li>YSLOW</li>
<li>Gomez</li>
<li>Smushit.com</li>
</ul>
</li>
<li>Ask Questions and Challenge answers</li>
</ul>
</li>
</ul>
<div>And thats the end.</div>
<div></div>
<div>I had so little time this year during the conference to get all this typed up that it just ended up dragging on. Hopefully I can fix that next year.</div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2008/10/15/the-ajax-experience-the-rest/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2008/10/15/the-ajax-experience-the-rest/</feedburner:origLink></item>
		<item>
		<title>The Ajax Experience Day 1</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/QSqx6DEKZuA/</link>
		<comments>http://www.justise.com/2008/09/30/the-ajax-experience-day-1/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 03:12:21 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[the ajax experience]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=184</guid>
		<description><![CDATA[Another year another Ajax Experience. I'm certainly lucky that my company sees the benefits of these events and is willing to send me to them. I think I've learned a bunch from my last event and hope that I can present the information in an easier fashion.
Keynote
This was a pretty similar keynote to the one [...]]]></description>
			<content:encoded><![CDATA[<p>Another year another Ajax Experience. I'm certainly lucky that my company sees the benefits of these events and is willing to send me to them. I think I've learned a bunch from my last event and hope that I can present the information in an easier fashion.</p>
<p><strong>Keynote</strong></p>
<p>This was a pretty similar keynote to the one last year. </p>
<ul>
<li>There was a brief mention of UX being crucial to the evolution of great, but no more follow up.</li>
<li>Ben and Dion did this thing where they setup a random buzzer and when it sounded they would trade off on who was speaking. Sure kept things interesting. </li>
<li>More of a hello, this stuff is exciting talk.</li>
</ul>
<div><strong>Google Chrome</strong></div>
<div>Its interesting that this year seams to be the year of the JavaScript engine. It was a big reason for the conception of a new browser on behalf of google. </div>
<div>
<ul>
<li>Started the browser project 2 years ago, when JavaScript engines weren't getting a lot of attention.</li>
<li>Based on the rendering engine of WebKit. They liked webkit because it was fast.(May have been some other reasons but they escape my memory)</li>
<li>3 Core principals (Stability, Performance, Developer Friendly)</li>
<li>Plan to continue development with those 3 principals in mind.</li>
<li>No never ending alert box</li>
<li>Use the nightlies, they haver lots of good stuff in them.</li>
<li>Linux and Mac are first class citizens in terms of importance, they just aren't releasable yet.</li>
</ul>
<div><strong>Top 10 Cross Browser Issues</strong></div>
<div>I was like 5 minutes late to this session so I didn't catch the introductions, there was some good content in here that I'm just not going to be able to get to detailed on.</div>
<div>
<ul>
<li>Dropping support for Safari 2. Doesn't have good accessibility capabilities. </li>
<li>Most on the panel agreed there are 2 main levels of support. Primary which means we want everything working perfectly in that browser, and the others where if its crashing we'll fix it, otherwise maybe we'll think about it.</li>
<li>There was a lengthy talk about browser detection vs feature detection. With jQuery moving to feature detection John was in the camp that if you do feature detection then you have future browser support. </li>
<li>When do you begin testing a browser release seriously? Beta.</li>
<li>What browser inconsistencies do you despise the most? (No way to detect if an event is implemented, Rich text editors, accurate attribute values back from IE--href, HasLayout)</li>
<li>What JS Library would you suggest if you couldn't suggest your own. (Prototype guy: jQuery, Dojo Guy: Goo, Yahoo Guy: jQuery, JohnResig: Prototype)</li>
<li>Would you ever consider consolidating the libraries? Not suprisingly dojo has already been doing this, the other libraries didn't say anything.</li>
</ul>
<div>That was the end of Day 1. Day 2 is 12 hours of learning fun, so I'll have lots more to cover.</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2008/09/30/the-ajax-experience-day-1/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2008/09/30/the-ajax-experience-day-1/</feedburner:origLink></item>
		<item>
		<title>Project Horror Story</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/3rvWqmNbm7Q/</link>
		<comments>http://www.justise.com/2008/09/24/project-horror-story/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 06:00:06 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[entertainment]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=182</guid>
		<description><![CDATA[I've read a lot about process, methodologies, and project life cycles. I've been able to put those practices in place quite a bit, and I never though I would be involved in the type of project I am involved with now. I can't but help blog about it, even though I know its not in [...]]]></description>
			<content:encoded><![CDATA[<p>I've read a lot about process, methodologies, and project life cycles. I've been able to put those practices in place quite a bit, and I never though I would be involved in the type of project I am involved with now. I can't but help blog about it, even though I know its not in my best interest to do so. Anyway, on with the show.</p>
<p>We (as in Method SF) were pulled in about 2 weeks ago to help out on a project that was frankly going into the toilet, quickly. The team had estimated about 8 days of work, for 3 developers to get it all done, and it turns out they were just freakishly optimistic.</p>
<p>The first thing that happens is that our two best flash guys get immediately put on the super hard feature of the site which is this fancy flash video selector.  Then, me and another guy get pulled in to do QA on HTML templates, which have yet to be integrated with the system. Finally, we pull in the last remaining guy on our tech team who wasn't involved with the project (now 5 of us) to do additional QA and help out any way he can.</p>
<p>Now besides the fact that we know this is a recipe for failure (people go around quoting Mythical Man Month, and something about 9, 1 month baby's) we still think it is the only way to get the project done by Monday. No not this next Monday (its Tuesday as I write this) but yesterday, which was supposed to be the end of development and the start of QA. They actually worked over the weekend to try to his this date, which doesn't seem that silly but it gets more ridiculous.</p>
<p>They worked over the weekend, did a whole bunch of work, but it still turns out we won't be ready to integrate what we are doing in our office with the other groups work till Thursday. We don't actually expect to be done with development till Friday, and of course they are presenting to the client on Monday.</p>
<p>Now if its a little hard to understand the big WTF here, the gist is that they plan to code 12-14 hour days just to get every feature implemented by Friday, so they can show the client their nearly finished product. The expectations here are not beta quality, but QA complete, getting ready to ship work. That's never going to happen. The project will be smoke, mirrors, and most likely a Blue Screen of Death.</p>
<p>Monday also happens to be the day that the other group is planning to start phase 2 of the project, with a whole new set of requirements. Not only do they plan to be finished with the current site, they want to add on a whole new batch of work, basically making a QA pass impossible.</p>
<p>All through this process we've made attempts to get the left over work estimated and real expectations set, tried to get the customers expectations modified, and basically try to do everything in a smart intelligent way considering we know that the site won't actually be ready when everyone is really really hoping it will be.</p>
<p>Hoping won't change reality, if there are 10 people working on 30 features, and its going to take a month, then stop hoping and start doing something productive. Like managing the client, telling them you F'd up and that its going to take longer then expected.</p>
<p>I can't believe I'm on a project like this, absolutely horrendous.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2008/09/24/project-horror-story/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2008/09/24/project-horror-story/</feedburner:origLink></item>
		<item>
		<title>StackOverflow, seriously fun leisure reading.</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/lF_LeraE1D8/</link>
		<comments>http://www.justise.com/2008/09/19/stackoverflow-seriously-fun-leisure-reading/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 00:32:47 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[entertainment]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=178</guid>
		<description><![CDATA[I've really been enjoying StackOverflow since it came out. If your not familiar with Jeff Atwood's new site, here is the vision statement he blogged about at the onset of the project.
 
Stackoverflow is sort of like the anti-experts-exchange (minus the nausea-inducing sleaze and quasi-legal search engine gaming) meets wikipedia meets programming reddit. It is by programmers, for programmers, with the [...]]]></description>
			<content:encoded><![CDATA[<p>I've really been enjoying <a href="http://www.stackoverflow.com/" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/www.stackoverflow.com');">StackOverflow</a> since it came out. If your not familiar with Jeff Atwood's new site, here is the vision statement he blogged about at the onset of the project.</p>
<blockquote><p> </p>
<p><strong>Stackoverflow is sort of like the anti-<a href="http://experts-exchange.com/" onclick="javascript:urchinTracker ('/outbound/article/experts-exchange.com');">experts-exchange</a> (minus the nausea-inducing sleaze and quasi-legal search engine gaming) meets <a href="http://www.wikipedia.com/" onclick="javascript:urchinTracker ('/outbound/article/www.wikipedia.com');">wikipedia</a> meets <a href="http://programming.reddit.com/" onclick="javascript:urchinTracker ('/outbound/article/programming.reddit.com');">programming reddit</a>.</strong> It is by programmers, for programmers, with the ultimate intent of collectively increasing the sum total of <em>good</em> programming knowledge in the world. No matter what programming language you use, or what operating system you call home. Better programming is our goal.</p>
<p> </p></blockquote>
<p>The core directive Jeff and Joel set out to address was the issue of a good place to go for development knowledge. If you had a question, there should be once place that you know it should either be answered already, or shortly after you ask it.  </p>
<p>Jeff even goes as far as putting up a witty inspirational image with the caption <a href="http://www.codinghorror.com/blog/images/stackoverflow-none-of-us-is-as-dumb-as-all-of-us.jpg" target="_self" onclick="javascript:urchinTracker ('/outbound/article/www.codinghorror.com');">STACKOVERFLOW: None of us is as Dumb as All of Us</a>. Which again references that knowledge-base aspect of the site.</p>
<p>But I'm finding the real value in this site is actually for entertainment purposes. I probably take a break 2-3 times a day, and with my iPhone, when I'm waiting for a meeting or Appt., I can be just browsing the internet 10-12 times a day just killing time. For me to be able to browse StackOverflow and check out what the <a href="http://stackoverflow.com/?sort=hot" onclick="javascript:urchinTracker ('/outbound/article/stackoverflow.com');">latest greatest questions that have been asked</a>, <a href="http://stackoverflow.com/questions/tagged/javascript" onclick="javascript:urchinTracker ('/outbound/article/stackoverflow.com');">questions that I might be able to help out with</a>, or just <a href="http://stackoverflow.com/questions/63668/confessions-of-your-worst-wtf-moment-what-not-to-do" onclick="javascript:urchinTracker ('/outbound/article/stackoverflow.com');">questions with funny answers</a> that means I get to do more then kill time reading Digg I actually get to learn as my entertainment. </p>
<p>With that in mind, I think you could take the following Venn diagram Jeff uses to describe the site, and move the Digg/Reddit circle right on top of that asterisk.</p>
<p><a href="http://blackbeltcoder.net/wp-content/uploads/2008/09/stackoverflow-venn-diagram.png" onclick="javascript:urchinTracker ('/outbound/article/blackbeltcoder.net');"><img class="alignnone size-medium wp-image-179" title="stackoverflow-venn-diagram" src="http://blackbeltcoder.net/wp-content/uploads/2008/09/stackoverflow-venn-diagram.png" alt="" width="440" height="431" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2008/09/19/stackoverflow-seriously-fun-leisure-reading/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2008/09/19/stackoverflow-seriously-fun-leisure-reading/</feedburner:origLink></item>
		<item>
		<title>Google Ajax Libraries APIs, Mootools is a little lazy</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/_XcosCGXOdQ/</link>
		<comments>http://www.justise.com/2008/07/28/google-ajax-libraries-apis-mootools-is-a-little-lazy/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 23:45:54 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=176</guid>
		<description><![CDATA[Have you heard of the Google AJAX Libraries API hosting service before?
From their website...
The AJAX Libraries API is a content distribution network and loading  architecture for the most popular open source JavaScript libraries. By using the  Google AJAX API Loader's google.load() method, your application has high speed, globaly  available access to a [...]]]></description>
			<content:encoded><![CDATA[<p>Have you heard of the <a href="http://code.google.com/apis/ajaxlibs/" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">Google AJAX Libraries API</a> hosting service before?</p>
<p>From their website...</p>
<blockquote><p>The AJAX Libraries API is a content distribution network and loading  architecture for the most popular open source JavaScript libraries. By using the  <a href="/apis/ajax/documentation/?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac">Google AJAX API Loader's</a> google.load() method, your application has high speed, globaly  available access to a growing list of the most popular JavaScript open source  libraries</p></blockquote>
<p>Ignore that part about the google.load part, its really not necessary and just makes you include a JS file thats not really needed. The usage page provides URL's for you to include on your page that load either the full version of the library or a YUI compressed version.</p>
<p>The important bits of the above quote really though are</p>
<ul>
<li>Content Distribution Network for one of your JS files, usually one of the larger files.</li>
<li>As browsers have limits to the amount of files they can download from one domain, this allows the browser to download this file while it otherwise would have been waiting in the download queue.</li>
<li>Files are cached based on their URL, and if you would have happened to already have visited a site that uses this same library and version of that library then you'll skip downloading it on this site. Thats right, partial page caching, even if you've never visited the site.</li>
</ul>
<p>After news of this feature broke, we had a large email chain at our office about putting one of the most core files for your site out of your control. Back and forth we went, even some snide remarks, but essentially theres no way around the trust issue. You can have your own backup plans for if the file isn't included, but now your adding complexity for a relatively small gain, and at that point you might as well just include a local copy of the library and skip the Googl eAPI completely.</p>
<p>The Google API supports 5 (4 really) libraries that you can remote load this way.</p>
<ul>
<li><a href="documentation/index.html?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac#jquery">jQuery</a></li>
<li><a href="documentation/index.html?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac#prototype">prototype</a></li>
<li><a href="documentation/index.html?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac#script_aculo_us">script.aculo.us</a></li>
<li><a href="documentation/index.html?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac#mootools">MooTools</a></li>
<li><a href="documentation/index.html?PHPSESSID=10c8ca0ec6d9e888b6c5f949d17c34ac#dojo">dojo</a></li>
</ul>
<p>Though unfortunately MooTools is a little behind the times.  <a href="http://blog.mootools.net/2008/6/12/mootools-1-2-it-s-official" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/blog.mootools.net');">1.2 was announced on June 12th</a>, thats a month and a half ago from the creation of this post and its still not in the Google API. I checked the other libraries and they are all up to date, but haven't been updated since this service went live. So we don't yet know if this is a service that will be going stale as time progresses.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2008/07/28/google-ajax-libraries-apis-mootools-is-a-little-lazy/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2008/07/28/google-ajax-libraries-apis-mootools-is-a-little-lazy/</feedburner:origLink></item>
		<item>
		<title>Revisiting the font declaration</title>
		<link>http://feedproxy.google.com/~r/BlackBeltCoder/~3/x5Q4o7OpFSs/</link>
		<comments>http://www.justise.com/2008/07/26/revisiting-the-font-declaration/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 21:11:13 +0000</pubDate>
		<dc:creator>Kris Gray</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://blackbeltcoder.net/?p=166</guid>
		<description><![CDATA[So a while ago I posted about using the font CSS declaration to clean up your stylesheets a bit. I had been using the technique on a new project for the first time and it seemed to be working like a charm, till I did a quality check using Firefox.

So it turns out, it doesn't [...]]]></description>
			<content:encoded><![CDATA[<p>So a while ago I posted about <a href="http://blackbeltcoder.net/2008/07/02/elegance-with-the-font-css-property/" target="_self" onclick="javascript:urchinTracker ('/outbound/article/blackbeltcoder.net');">using the font CSS declaration to clean up your stylesheets</a> a bit. I had been using the technique on a new project for the first time and it seemed to be working like a charm, till I did a quality check using Firefox.</p>
<p><a href="http://blackbeltcoder.net/wp-content/uploads/2008/07/images.jpg" onclick="javascript:urchinTracker ('/outbound/article/blackbeltcoder.net');"><img class="alignnone size-medium wp-image-167" title="images" src="http://blackbeltcoder.net/wp-content/uploads/2008/07/images.jpg" alt="" width="133" height="73" /></a></p>
<p>So it turns out, it doesn't work. Not only does the font-family not get inherited but any other rules you specified get ignored as well.</p>
<p>Super annoying.  So I did what any good citizen would do. I complained.</p>
<p>Bug: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=448142" target="_blank" onclick="javascript:urchinTracker ('/outbound/article/bugzilla.mozilla.org');">#448142</a></p>
<p>The great thing about FireFox is that if they decide to fix this issue, they can have it pushed to the general public of FireFox users and this issue could be eradicated in weeks time. So here's hoping.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justise.com/2008/07/26/revisiting-the-font-declaration/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.justise.com/2008/07/26/revisiting-the-font-declaration/</feedburner:origLink></item>
	</channel>
</rss>
