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

<channel>
	<title>The Code Dojo &#187; JavaScript</title>
	<atom:link href="http://dojo.codegreene.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://dojo.codegreene.com</link>
	<description>The Code Dojo is the veritable repository of random musings from the development team at Code Greene.</description>
	<lastBuildDate>Fri, 20 Jan 2012 18:09:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Helpful jQuery Tricks, Notes, and Best Practices Part II</title>
		<link>http://dojo.codegreene.com/2012/01/helpful-jquery-tricks-notes-and-best-practices-part-ii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=helpful-jquery-tricks-notes-and-best-practices-part-ii</link>
		<comments>http://dojo.codegreene.com/2012/01/helpful-jquery-tricks-notes-and-best-practices-part-ii/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:07:31 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=931</guid>
		<description><![CDATA[Continuing the jQuery pain fun of some tips I&#8217;ve learned over the years&#8230; Read Part I Here Don&#8217;t Abuse $(this) Without knowing about the various DOM properties and functions, it can be easy to abuse the jQuery object needlessly. For instance: $('#someAnchor').click(function() { alert( $(this).attr('id') ); }); If our only need of the jQuery object [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-955" style="margin: 0 0 0 10px;" title="jquery-logo" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/jquery-logo.png" alt="jQuery Logo" width="195" height="48" />Continuing the jQuery <del datetime="2012-01-13T16:11:48+00:00">pain</del> fun of some tips I&#8217;ve learned over the years&#8230; <a title="Helpful jQuery Tricks, Notes, and Best Practices Part I" href="http://dojo.codegreene.com/2011/12/helpful-jquery-tricks-notes-and-best-practices-part-i/">Read Part I Here</a></p>
<p><strong>Don&#8217;t Abuse $(this)</strong><br />
Without knowing about the various DOM properties and functions, it can be easy to abuse the jQuery object needlessly. For instance:</p>
<pre>$('#someAnchor').click(function() {
    alert( $(this).attr('id') );
});</pre>
<p><span id="more-931"></span>If our only need of the jQuery object is to access the anchor tag&#8217;s id attribute, this is wasteful. Better to stick with &#8220;raw&#8221; JavaScript.</p>
<pre>$('#someAnchor').click(function() {
    alert( this.id );
});</pre>
<p>Please note that there are three attributes that should always be accessed, via jQuery: &#8220;src,&#8221; &#8220;href,&#8221; and &#8220;style.&#8221; These attributes require the use of getAttribute in older versions of IE.</p>
<pre>// jQuery Source
var rspecialurl = /href|src|style/;
// ...
var special = rspecialurl.test( name );
// ...
var attr = !jQuery.support.hrefNormalized &amp;&amp; notxml &amp;&amp; special ?
    // Some attributes require a special call on IE
    elem.getAttribute( name, 2 ) :
    elem.getAttribute( name );</pre>
<p><strong>Multiple jQuery Objects</strong><br />
Even worse is the process of repeatedly querying the DOM and creating multiple jQuery objects.</p>
<pre>$('#elem').hide();
$('#elem').html('bla');
$('#elem').otherStuff();</pre>
<p>Hopefully, you&#8217;re already aware of how inefficient this code is. If not, that&#8217;s okay; we&#8217;re all learning. The answer is to either implement chaining, or to &#8220;cache&#8221; the location of #elem.</p>
<pre>// This works better
$('#elem')
  .hide()
  .html('bla')
  .otherStuff();  

// Or this, if you prefer for some reason.
var elem = $('#elem');
elem.hide();
elem.html('bla');
elem.otherStuff();</pre>
<p><strong>jQuery&#8217;s Shorthand Ready Method</strong><br />
Listening for when the document is ready to be manipulated is laughably simple with jQuery.</p>
<pre>$(document).ready(function() {
    // let's get up in heeya
});</pre>
<p>Though, it&#8217;s very possible that you might have come across a different, more confusing wrapping function.</p>
<pre>$(function() {
    // let's get up in heeya
});</pre>
<p>Though the latter is somewhat less readable, the two snippets above are identical. Don&#8217;t believe me? Just check the jQuery source.</p>
<pre>// HANDLE: $(function)
// Shortcut for document ready
if ( jQuery.isFunction( selector ) ) {
    return rootjQuery.ready( selector );
}</pre>
<p>rootjQuery is simply a reference to the root jQuery(document). When you pass a selector to the jQuery function, it&#8217;ll determine what type of selector you passed: string, tag, id, function, etc. If a function was passed, jQuery will then call its ready() method, and pass your anonymous function as the selector.</p>
<p><strong>Keep your Code Safe</strong><br />
If developing code for distribution, it&#8217;s always important to compensate for any possible name clashing. What would happen if some script, imported after yours, also had a $ function? Bad juju!</p>
<p>The answer is to either call jQuery&#8217;s noConflict(), or to store your code within a self-invoking anonymous function, and then pass jQuery to it.</p>
<p>Method 1: NoConflict</p>
<pre>var j = jQuery.noConflict();
// Now, instead of $, we use j.
j('#someDiv').hide();  

// The line below will reference some other library's $ function.
$('someDiv').style.display = 'none';</pre>
<p>Be careful with this method, and try not to use it when distributing your code. It would really confuse the user of your script! :)</p>
<p>Method 2: Passing jQuery</p>
<pre>(function($) {
    // Within this function, $ will always refer to jQuery
})(jQuery);</pre>
<p>The final parens at the bottom call the function automatically &#8212; function(){}(). However, when we call the function, we also pass jQuery, which is then represented by $.</p>
<p>Method 3: Passing $ via the Ready Method</p>
<pre>jQuery(document).ready(function($) {
 // $ refers to jQuery
});  

// $ is either undefined, or refers to some other library's function.</pre>
<p><strong>Be Smart</strong></p>
<p>Remember &#8212; jQuery is just JavaScript. Don&#8217;t assume that it has the capacity to compensate for your bad coding. :)</p>
<p>This means that, just as we must optimize things such as JavaScript for statements, the same is true for jQuery&#8217;s each() method. And why wouldn&#8217;t we? It&#8217;s just a helper method, which then creates a for statement behind the scenes.</p>
<pre>// jQuery's each method source
    each: function( object, callback, args ) {
        var name, i = 0,
            length = object.length,
            isObj = length === undefined || jQuery.isFunction(object);  

        if ( args ) {
            if ( isObj ) {
                for ( name in object ) {
                    if ( callback.apply( object[ name ], args ) === false ) {
                        break;
                    }
                }
            } else {
                for ( ; i &lt; length; ) {
                    if ( callback.apply( object[ i++ ], args ) === false ) {
                        break;
                    }
                }
            }  

        // A special, fast, case for the most common use of each
        } else {
            if ( isObj ) {
                for ( name in object ) {
                    if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
                        break;
                    }
                }
            } else {
                for ( var value = object[0];
                    i &lt; length &amp;&amp; callback.call( value, i, value ) !== false; value = object[++i] ) {}
            }
        }  

        return object;
    }</pre>
<p>Awful</p>
<pre>someDivs.each(function() {
    $('#anotherDiv')[0].innerHTML += $(this).text();
});</pre>
<p>The above:</p>
<ol>
<li>Searches for anotherDiv for each iteration</li>
<li>Grabs the innerHTML property twice</li>
<li>Creates a new jQuery object, all to access the text of the element.</li>
</ol>
<p>Better</p>
<pre>var someDivs = $('#container').find('.someDivs'),
      contents = [];  

someDivs.each(function() {
    contents.push( this.innerHTML );
});
$('#anotherDiv').html( contents.join('') );</pre>
<p>This way, within the each (for) method, the only task we&#8217;re performing is adding a new key to an array&#8230;as opposed to querying the DOM, grabbing the innerHTML property of the element twice, etc.</p>
<p>This next tip is more JavaScript-based in general, rather than jQuery specific&#8230; The point is to remember that jQuery doesn&#8217;t compensate for poor coding.</p>
<p><strong>Document Fragments</strong></p>
<p>While we&#8217;re at it, another option for these sorts of situations is to use document fragments.</p>
<pre>var someUls = $('#container').find('.someUls'),
    frag = document.createDocumentFragment(),
    li;  

someUls.each(function() {
    li = document.createElement('li');
    li.appendChild( document.createTextNode(this.innerHTML) );
    frag.appendChild(li);
});  

$('#anotherUl')[0].appendChild( frag );</pre>
<p>The key here is that there are multiple ways to accomplish simple tasks like this, and each have their own performance benefits from browser to browser. The more you stick with jQuery and learn JavaScript, you also might find that you refer to JavaScript&#8217;s native properties and methods more often. And, if so, that&#8217;s fantastic!</p>
<p>jQuery provides an amazing level of abstraction that you should take advantage of, but this doesn&#8217;t mean that you&#8217;re forced into using its methods. For example, in the fragment example above, we use jQuery&#8217;s each method. If you prefer to use a for or while statement instead, that&#8217;s okay too!</p>
<p>With all that said, keep in mind that the jQuery team have heavily optimized this library. The debates about jQuery&#8217;s each() vs. the native for statement are silly and trivial. If you are using jQuery in your project, save time and use their helper methods. That&#8217;s what they&#8217;re there for! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2012/01/helpful-jquery-tricks-notes-and-best-practices-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharpening the Blades: Website Usability, Analytiks and impress.js</title>
		<link>http://dojo.codegreene.com/2012/01/sharpening-the-blades-website-usability-analytiks-and-impress-js/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-website-usability-analytiks-and-impress-js</link>
		<comments>http://dojo.codegreene.com/2012/01/sharpening-the-blades-website-usability-analytiks-and-impress-js/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 18:06:14 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Analytiks]]></category>
		<category><![CDATA[Impress JS]]></category>
		<category><![CDATA[iPhone App]]></category>
		<category><![CDATA[iPhone Google Analytics App]]></category>
		<category><![CDATA[Website Usability]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=914</guid>
		<description><![CDATA[Chad, 22 Tools for Testing Your Websites Usability One thing that we here at Code Greene have been trying to do is pushing our limits by getting faster and better at development. But with this we have realized that we need to help the pursued the client to get the best site they can. These [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://dojo.codegreene.com/wp-content/uploads/2012/01/mashable-22-tools-for-testing.png"><img class="alignright size-full wp-image-918" style="border: 1px solid #444444; margin: 8px 0pt 0 20px; padding: 2px;" title="mashable-22-tools-for-testing" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/mashable-22-tools-for-testing.png" alt="Mashable 22 Essential Tools for Testing" width="100" height="100" /></a>Chad, <a href="http://mashable.com/2011/09/30/website-usability-tools" target="_blank">22 Tools for Testing Your Websites Usability</a></strong><br />
One thing that we here at Code Greene have been trying to do is pushing our limits by getting faster and better at development. But with this we have realized that we need to help the pursued the client to get the best site they can. These clients come to us with an idea and they know their industry well, but it is our job and responsibility to take their ideas and build it in a way that is needed to give the end user what they want and need quickly.</p>
<p><strong><img class="alignright size-full wp-image-925" style="border: 1px solid #444444; margin: 8px 0pt 0 20px; padding: 2px;" title="analytiks" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/analytiks.png" alt="" width="100" height="100" />Luke, <a href="http://analytiksapp.com/" target="_blank">Analytiks iPhone App</a></strong><br />
A little while ago I stumbled upon this little app for my iPhone. For those of us that don&#8217;t sign in to our Google Analytics often but know we should this app will be very valuable. Analytiks shows me just the important information I&#8217;d like to know about my websites on my phone. I can check it quick and get back to whatever else is going on that day. The interface is quite nice. I would ditch the rusted sign look myself but other than that it is fantastic. It is 99 cents in the app store.</p>
<p><strong><img class="alignright size-full wp-image-917" style="border: 1px solid #444444; margin: 8px 0pt 20px 20px; padding: 2px;" title="impress-js" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/impress-js.png" alt="Impress JS" width="100" height="100" />Benjam, <a href="http://bartaz.github.com/impress.js/#/bored" target="_blank">impress.js</a></strong><br />
It&#8217;s not much in the way of content, but the way that content is displayed. It&#8217;s simple&#8230; yet eye catching and very intriguing. Makes me very excited about where the web is heading.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2012/01/sharpening-the-blades-website-usability-analytiks-and-impress-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helpful jQuery Tricks, Notes, and Best Practices Part I</title>
		<link>http://dojo.codegreene.com/2011/12/helpful-jquery-tricks-notes-and-best-practices-part-i/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=helpful-jquery-tricks-notes-and-best-practices-part-i</link>
		<comments>http://dojo.codegreene.com/2011/12/helpful-jquery-tricks-notes-and-best-practices-part-i/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 20:34:22 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Sizzle]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=901</guid>
		<description><![CDATA[If there is one bad thing about jQuery, it’s that the entry level is so amazingly low, that it tends to attract those who haven’t an ounce of JavaScript knowledge. Now, on one hand, this is fantastic. However, on the flip side, it also results in a smattering of, quite frankly, disgustingly bad code (no [...]]]></description>
			<content:encoded><![CDATA[<p>If there is one bad thing about jQuery, it’s that the entry level is so amazingly low, that it tends to attract those who haven’t an ounce of JavaScript knowledge. Now, on one hand, this is fantastic. However, on the flip side, it also results in a smattering of, quite frankly, disgustingly bad code (no one is immune to this). But that’s okay; frighteningly poor code that would even make your grandmother gasp is a rite of passage. The key is to climb over the hill, and that’s what we’ll discuss today.<span id="more-901"></span></p>
<p><strong>Methods Return the jQuery Object</strong><br />
It’s important to remember that most methods will return the jQuery object. This is extremely helpful, and allows for the chaining functionality that we use so often.</p>
<pre>$someDiv
.attr('class', 'someClass')
.hide()
.html('new stuff');</pre>
<p>Knowing that the jQuery object is always returned, we can use this to remove superfluous code at times. For example, consider the following code:</p>
<pre>var someDiv = $('#someDiv');
someDiv.hide();</pre>
<p>The reason why we &#8220;cache&#8221; the location of the someDiv element is to limit the number of times that we have to traverse the DOM for this element to once. The code above is perfectly fine; however, you could just as easily combine the two lines into one, while achieving the same outcome.</p>
<pre>var someDiv = $('#someDiv').hide();</pre>
<p>This way, we still hide the someDiv element, but the method also, as we learned, returns the jQuery object — which is then referenced via the someDiv variable.</p>
<p><strong>The Find Selector</strong><br />
As long as your selectors aren’t ridiculously poor, jQuery does a fantastic job of optimizing them as best as possible, and you generally don’t need to worry too much about them. However, with that said, there are a handful of improvements you can make that will slightly improve your script’s performance. One such solution is to use the find() method, when possible.</p>
<pre>// Fine in modern browsers, though Sizzle does begin "running"
$('#someDiv p.someClass').hide();

// Better for all browsers, and Sizzle never inits.
$('#someDiv').find('p.someClass').hide();</pre>
<p>The latest modern browsers have support for QuerySelectorAll, which allows you to pass CSS-like selectors, without the need for jQuery. jQuery itself checks for this function as well. However, older browsers, namely IE6/IE7, understandably don’t provide support. What this means is that these more complicated selectors trigger jQuery’s full Sizzle engine, which, though brilliant, does come along with a bit more overhead. Sizzle is a brilliant mass of code that I may never understand. However, in a sentence, it first takes your selector and turns it into an &#8220;array&#8221; composed of each component of your selector.</p>
<pre>// Rough idea of how it works
['#someDiv, 'p'];</pre>
<p>It then, from right to left, begins deciphering each item with regular expressions. What this also means is that the right-most part of your selector should be as specific as possible &#8211; for instance, an id or tag name.</p>
<p>Bottom line, when possible:</p>
<ul>
<li>Keep your selectors simple</li>
<li>Utilize the find() method. This way, rather than using Sizzle, we can continue using the browser’s native functions.</li>
<li>When using Sizzle, optimize the right-most part of your selector as much as possible.</li>
</ul>
<p><strong>Context instead?</strong><br />
It&#8217;s also possible to add a context to your selectors, such as:</p>
<pre>$('.someElements', '#someContainer').hide();</pre>
<p>This code directs jQuery to wrap a collection of all the elements with a class of someElements &#8211; that are children of someContainer &#8211; within jQuery. Using a context is a helpful way to limit DOM traversal, though, behind the scenes, jQuery is using the find method instead.</p>
<pre>$('#someContainer')
.find('.someElements')
.hide();</pre>
<p>I hope this first installment has been useful to someone out there in the interweb, and if not, maybe my next few will be!</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/12/helpful-jquery-tricks-notes-and-best-practices-part-i/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sharpening The Blades: Texture on the Web &amp; JavaScript Powering Linux</title>
		<link>http://dojo.codegreene.com/2011/10/sharpening-the-blades-texture-on-the-web-javascript-powering-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-texture-on-the-web-javascript-powering-linux</link>
		<comments>http://dojo.codegreene.com/2011/10/sharpening-the-blades-texture-on-the-web-javascript-powering-linux/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 18:07:41 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Texture]]></category>
		<category><![CDATA[Web Texture]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=738</guid>
		<description><![CDATA[Mark, Art and The Web Texture I thought this was a nice article and analysis of Textures by Nick Petite. Though to many people texture may seem like a subtle thing we feel it is an important part of a website for creating the right mood. The thing that Nick points out is how much [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-740 alignright" style="border: 1px solid #444444; margin: 8px 0pt 20px 20px; padding: 2px;" title="art-texture" src="http://dojo.codegreene.com/wp-content/uploads/2011/10/art-texture.jpg" alt="Art and The Web Texture" width="100" height="100" /></p>
<p>Mark, <a href="http://thinkvitamin.com/art-and-the-web/art-and-the-web-texture/" target="_blank">Art and The Web Texture</a><br />
I thought this was a nice article and analysis of Textures by Nick Petite. Though to many people texture may seem like a subtle thing we feel it is an important part of a website for creating the right mood. The thing that Nick points out is how much more dynamic a website can seem once a more interesting texture is added. In web design, I personally really like the layered texture strategies because it helps to neutralize an otherwise potentially overbearing texture, Nick covers the gambit of options and provides some examples, check it out.</p>
<p><img class="alignright size-full wp-image-741" style="border: 1px solid #444444; margin: 8px 0pt 20px 20px; padding: 2px;" title="javascript-linux" src="http://dojo.codegreene.com/wp-content/uploads/2011/10/javascript-linux.jpg" alt="JavaScript Powers Linux In A Browser" width="100" height="100" />Brian, <a href="http://www.builderau.com.au/news/soa/JavaScript-powers-Linux-in-a-browser/0,339028227,339315250,00.htm" target="_blank">JavaScript Powers Linux In A Browser</a><br />
I get asked all the time &#8216;Why Linux?&#8217; and &#8216;How lightweight it is?&#8217;. My usual reply references how Ive seen a Linux web server run off a 2GB thumb drive, but this article trumps even that. With all the overhead the operating systems of today require, people usually assume a servers absolute minimum is even higher. Running Linux in a client-side script like this just blows my mind!</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/10/sharpening-the-blades-texture-on-the-web-javascript-powering-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 PIE and WordPress</title>
		<link>http://dojo.codegreene.com/2011/10/css3-pie-and-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-pie-and-wordpress</link>
		<comments>http://dojo.codegreene.com/2011/10/css3-pie-and-wordpress/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 21:56:25 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSS Pie]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE7 CSS3]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=735</guid>
		<description><![CDATA[We all love CSS3 and the things we can do with it. It is saddening when a client opens up the site you just coded and doesn&#8217;t see all the CSS3 goodness because they are using some version of IE. Frequently, CSS3 PIE has saved me from the client saying: &#8220;Why don&#8217;t the buttons have [...]]]></description>
			<content:encoded><![CDATA[<p>We all love CSS3 and the things we can do with it. It is saddening when a client opens up the site you just coded and doesn&#8217;t see all the CSS3 goodness because they are using some version of IE. Frequently, <a href="http://css3pie.com/" target="_blank">CSS3 PIE</a> has saved me from the client saying: &#8220;Why don&#8217;t the buttons have the rounded corners like your design?&#8221;</p>
<p>CSS3 PIE makes some CSS3 features work in IE6 &#8211; 9. It supports border-radius, box-shadow, and linear-gradient. It works great and is super easy to set up. Unless you use it in WordPress. After some Google searching, a fair amount of testing, and a lot of grumbling I got it working in a WordPress site. It is really simple. I hope that this will save others from some headache.</p>
<p>1. Put the PIE.htc file in the WP Root directory and then reference it in your css as &#8211; behavior: url(&#8220;PIE.htc&#8221;);<br />
2. All the elements that use CSS3 features will need either position: relative or position: block on them</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/10/css3-pie-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Geolocation</title>
		<link>http://dojo.codegreene.com/2010/10/geolocation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=geolocation</link>
		<comments>http://dojo.codegreene.com/2010/10/geolocation/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 21:39:35 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=647</guid>
		<description><![CDATA[Mobile applications are all the rage as smart phones are moving from smart to genius. Along with this movement is the movement to location aware applications. Your phone has GPS, your laptop has wifi, and your IP is known (generally) to be tied to a specific location. Given these new technologies being more commonplace the [...]]]></description>
			<content:encoded><![CDATA[<p>Mobile applications are all the rage as smart phones are moving from smart to genius. Along with this movement is the movement to location aware applications. Your phone has GPS, your laptop has wifi, and your IP is known (generally) to be tied to a specific location. Given these new technologies being more commonplace<a href="http://www.w3c.org"> the W3C</a> has seen it fit to add <a href="http://dev.w3.org/geo/api/spec-source.html">an API</a> to web design for Geo Location.</p>
<p>Although not technically a piece of the <a href="http://dev.w3.org/html5/spec/Overview.html">HTML5 spec</a>, it is commonly used in conjunction with HTML5 and easy to use.</p>
<p>The geolocation API exposes three methods on the navigator object in javascript, two for getting location information about your user <strong>getCurrentPosition</strong> and <strong>watchPosition</strong>, and the other is a paired method for watchPosition, it is <strong>clearWatch</strong>.</p>
<p>The first, getCurrentPosition, returns a one time shot of where the user is. This is good for pinning a map or giving static directions. The second, watchPosition, continues polling at regular intervals to keep tabs on where the user is. This is perfect for giving dynamic directions, or tracking a movement. The two calls are mirrors of one another in that they both accept three arguments (success handler, error handler, geolocation options). The two calls are also both asynchronous, with a caveat that if this is a user&#8217;s first visit to your site they may be prompted to allow their position to be shared, this could cause the browser to stop loading.</p>
<p>The odd ball function here is clearWatch, which simply clears any watches you have assigned, in other words it stops tracking your user.</p>
<p>Now that we know the basics let&#8217;s dig in!</p>
<pre><code>if(navigator.geolocation){
     navigator.geolocation.getCurrentPosition(function (position){
         var lat = position.coords.latitude;
         var lon = position.coords.longitude;

         alert('Lat: '+ lat +' \nLon: '+ lon);
     }
}</code></pre>
<p>The example above is about as simple as it gets, a simple one shot to get the users coordinates and then output them to the browser.</p>
<p>That is all there is to Geolocation in the browser, pair it up with Google Maps API and you have an award winning geolocation application ready to please the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2010/10/geolocation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharpening the Blades: Future of Web Typography, Helpful jQuery Methods, April Fools &#8211; PHP Style</title>
		<link>http://dojo.codegreene.com/2010/04/sharpening-the-blades-future-of-web-typography-helpful-jquery-methods-april-fools-php-style/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-future-of-web-typography-helpful-jquery-methods-april-fools-php-style</link>
		<comments>http://dojo.codegreene.com/2010/04/sharpening-the-blades-future-of-web-typography-helpful-jquery-methods-april-fools-php-style/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 21:11:11 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[April Fools]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=576</guid>
		<description><![CDATA[This April Fools edition of Sharpening the Blades only has two serious articles and we&#8217;ll let you decide on the last one. Luke talks about the Future of Web Typography, Benjam talks about jQuery Methods and Mac, well, Mac is the playful one at the office so he chimes in with his April Fools joke [...]]]></description>
			<content:encoded><![CDATA[<p>This April Fools edition of Sharpening the Blades only has two serious articles and we&#8217;ll let you decide on the last one. Luke talks about the Future of Web Typography, Benjam talks about jQuery Methods and Mac, well, Mac is the playful one at the office so he chimes in with his April Fools joke for all you PHP gurus.</p>
<p><strong>Luke</strong>,<a href="http://www.smashingmagazine.com/2010/03/01/css-and-the-future-of-text/" target="_blank"> Future of Web Typography</a><img class="alignright size-full wp-image-581" style="border: 1px solid #444444; margin: 8px 0pt 0pt 20px; padding: 2px;" title="web-typography" src="http://dojo.codegreene.com/wp-content/uploads/2010/04/web-typography.jpg" alt="" width="100" height="100" /><br />
For years typography on the web has been very limited when compared to what can be in the print world. Over the last few years though we have been given more and more tools to help us accomplish good typography on the web. As time goes on these tools will get better and will become more widely supported. There was an article on Smashing Magazine this week that talked about a lot of these tools that are available to web designers. I really enjoyed reading up, refreshing my memory of code I haven&#8217;t used in a while, and also learning some new ways of styling type. Read it over, the text on your website will be very happy you did.</p>
<p><strong>Benjam,</strong> <a href="http://net.tutsplus.com/tutorials/javascript-ajax/20-helpful-jquery-methods-you-should-be-using/" target="_blank">20 Helpful jQuery Methods You Should Be Using</a><img class="alignright size-full wp-image-579" style="border: 1px solid #444444; margin: 8px 0pt 0px 20px; padding: 2px;" title="nettuts" src="http://dojo.codegreene.com/wp-content/uploads/2010/04/nettuts.jpg" alt="" width="100" height="100" /><br />
While developing a website, I use a lot of tools, both in the creation of the website files (my text editor of choice, file manager, etc.), and within the website itself (CakePHP, jQuery, CSS, etc.), and I&#8217;m always interested in finding features of those tools that I might not be very familiar with.  While I have a deep familiarity with the features I use regularly, and a passing familiarity with most of the features of these tools, it&#8217;s always good to get a refresher on what I could be using more.  Here is a post highlighting 20 jQuery methods/features (actually 33 methods in 20 groups) that should be in everybody&#8217;s familiarity tool box.</p>
<p>Mac, <a href="http://phpdeveloper.org/news/14281" target="_blank">April Fools &#8211; PHP Style</a><img class="alignright size-full wp-image-580" style="border: 1px solid #444444; margin: 8px 0pt 0pt 20px; padding: 2px;" title="phpdeveloper" src="http://dojo.codegreene.com/wp-content/uploads/2010/04/phpdeveloper.jpg" alt="" width="100" height="100" /><br />
This discusses a topic that we often only think about once or twice a year, but it is still worthy of our attention and deserves some practice to improve our skills. Also, while you are there, subscribe to the <a href="http://www.phpdeveloper.org/feed" target="_blank">PHP Developers feed</a>. The main guy, Chris Cornutt, does an excellent job of filtering the best PHP articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2010/04/sharpening-the-blades-future-of-web-typography-helpful-jquery-methods-april-fools-php-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharpening the Blades: Styling Forms, Problem with Passwords and HTML5 in IE9</title>
		<link>http://dojo.codegreene.com/2010/03/sharpening-the-blades-styling-forms-problem-with-passwords-and-html5-in-ie9/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-styling-forms-problem-with-passwords-and-html5-in-ie9</link>
		<comments>http://dojo.codegreene.com/2010/03/sharpening-the-blades-styling-forms-problem-with-passwords-and-html5-in-ie9/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 17:00:07 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Internet Explorer 9]]></category>
		<category><![CDATA[Passwords]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=485</guid>
		<description><![CDATA[This edition of Sharpening the Blades features an article from Mike about using jQuery, CSS and image sprites to create stylish forms, an article from Benjam about Passwords on the web and Mark chimes in with an article about the possibility of HTML5 in Internet Explorer 9. Mike, Get your form on with Uniform We&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>This edition of Sharpening the Blades features an article from Mike about using jQuery, CSS and image sprites to create stylish forms, an article from Benjam about Passwords on the web and Mark chimes in with an article about the possibility of HTML5 in Internet Explorer 9.</p>
<p><strong>Mike</strong>,<a href="http://pixelmatrixdesign.com/uniform/" target="_blank"> Get your form on with Uniform<img class="alignright size-full wp-image-487" style="border: 1px solid #444444; margin: 8px 0pt 0pt 20px; padding: 2px;" title="uniform" src="http://dojo.codegreene.com/wp-content/uploads/2010/03/uniform.png" alt="uniform" width="100" height="100" /><br />
</a>We&#8217;ve all been there. You finish an amazing design using some sweet custom form elements that perfectly match the theme of your design. Then after a few frustrating attempts, you realize that some form elements just can&#8217;t be styled. Or if they can, not consistently. So you throw on a border, maybe a background image, and hope for the best as dreams of your custom UI vanish into nothingness. But fear not! Using the clever jQuery script Uniform and some CSS sprites, your form designs can once more be glorious! Works beautifully in all major browsers (degrades gracefully in IE6). <a href="http://pixelmatrixdesign.com/uniform/)" target="_blank"><br />
</a></p>
<p><strong>Benjam</strong>, <a href="http://www.alistapart.com/articles/the-problem-with-passwords/" target="_blank">The Problem with Passwords</a><img class="alignright size-full wp-image-489" style="border: 1px solid #444444; margin: 8px 0pt 0pt 20px; padding: 2px;" title="passwords" src="http://dojo.codegreene.com/wp-content/uploads/2010/03/passwords.jpg" alt="passwords" width="100" height="100" /><br />
Being in the Web Development industry for a while now, and having had a few third-party scripts that were on my site hacked, I have become more and more interested in web security.  Passwords are on the front lines to that.  Being a user of Web technologies, I&#8217;m also interested in usability and choice, and when it comes to showing or hiding passwords (what? you can do that?) I&#8217;m in the boat of give the user the choice.  This article nicely explains a few examples that offer people the choice to show or hide their passwords, both of which are very useful.</p>
<p><strong>Mark</strong>, <a href="http://www.webmonkey.com/blog/Microsoft_to_Double_Down_on_HTML5_With_Internet_Explorer_9" target="_blank">Microsoft to Double Down on HTML5 in Internet Explorer 9</a><img class="alignright size-full wp-image-488" style="border: 1px solid #444444; margin: 8px 0pt 0pt 20px; padding: 2px;" title="internetexplorer" src="http://dojo.codegreene.com/wp-content/uploads/2010/03/internetexplorer.jpg" alt="internetexplorer" width="100" height="100" /><br />
Doubling down seems like the wrong approach to me. If I were the CEO at Microsoft I would instead of thinking of trying to put their foot down harder, they should instead learn to bend in the winds of the market and work on compliance with the other browsers. Though I hate to say it even forced upgrades like Firefox does would be good, to keep people current and reduce the amount of cross browsers compatibility problems Microsoft gives developers. I don&#8217;t think Microsoft realizes that by making developers lives bad by trying to be different they are actually building up a mass market of developers who hate them because it is so difficult to make cross compatibility easy and affordable.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2010/03/sharpening-the-blades-styling-forms-problem-with-passwords-and-html5-in-ie9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why is coding so personal?</title>
		<link>http://dojo.codegreene.com/2010/02/why-is-coding-so-personal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-is-coding-so-personal</link>
		<comments>http://dojo.codegreene.com/2010/02/why-is-coding-so-personal/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 20:26:57 +0000</pubDate>
		<dc:creator>Benjam</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[coding style]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=448</guid>
		<description><![CDATA[I&#8217;ve been noticing that often times, when getting or giving feedback on code, or browsing my favorite programming forum, or just reading posts about programming, that people often get very emotional about their code. I was wondering why this is, and because I am not a psychologist, I&#8217;ll just give you my thoughts. Coding to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-477" title="Why is coding so personal?" src="http://dojo.codegreene.com/wp-content/uploads/2010/02/personal1.jpg" alt="Why is coding so personal?" width="520" height="150" /><br />
I&#8217;ve been noticing that often times, when getting or giving feedback on code, or browsing my favorite programming forum, or just reading posts about programming, that people often get very emotional about their code.  I was wondering why this is, and because I am not a psychologist, I&#8217;ll just give you my thoughts.</p>
<p>Coding to me is like creating art, and there&#8217;s a great quote that backs me up on this:</p>
<blockquote><p>Programming is an art form that fights back. —Unknown</p></blockquote>
<p>Because code is like art, I get very attached to my code, as well as my style of coding.  My code is like my baby, my something from nothing that wouldn&#8217;t be there if it weren&#8217;t for me. It&#8217;s just a bunch of characters on the screen that, from somewhere in the blue smoke, creates a function, or a game, or a website.  I have received criticism on my code (as everyone has), as well as given criticism on other&#8217;s code (as everyone has), and those times when I&#8217;ve received criticism on my code, depending on how it was delivered, or what was said, it was almost like a personal attack on me.  And I&#8217;ve noticed a few other coders react the same way to criticisms on their code.  It&#8217;s like the person who called your code ugly or inelegant was saying that your child was ugly (and those of you who have kids know&#8230; that&#8217;s a huge no-no, punishable by any means available).</p>
<p>It may be because I think that my coding style is the best, it&#8217;s what I&#8217;m used to, and it&#8217;s the format I use because it&#8217;s the easiest for me to get at the information I need as fast as possible.  I know this because I&#8217;ve tried other styles (sometimes flipping back and forth in the same day), and looking at someone else&#8217;s code that uses a different style from me, is often times hard to peruse easily.  It&#8217;s what I like, and sometimes I have to hold myself back from reformatting code I come across into my own style.</p>
<p>So maybe we should stop thinking of code and coding styles as being &#8220;right&#8221; or &#8220;wrong&#8221;, and think of them more like the tool that they are, a means to an end.  And the way you react to someone else&#8217;s means should be a little more like a suggestion for a different method of painting.  Not a matter of fact, but just another tool for the tool box.</p>
<p>To continue the art analogy, it&#8217;s like everybody is given all the art supplies in the world, and told to make/paint/draw/create a box.  Everyone will come up with a different way of doing it, some will be huge and bright red; others will be small and drawn in pencil; others still might be made of clay or brick.  No matter what, it&#8217;s the way you chose to do it, and it&#8217;s no better or worse than the person&#8217;s next to you.  You might think so because yours was faster, fancier, more elegant, or more &#8220;boxy&#8221;; but they might think the opposite.  In the end, you still have a box, and so do they.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2010/02/why-is-coding-so-personal/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sharpening the Blades: Document Ready, Admins and Automagic in CakePHP</title>
		<link>http://dojo.codegreene.com/2010/01/sharpening-the-blades-document-ready-admins-and-automagic-in-cakephp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-document-ready-admins-and-automagic-in-cakephp</link>
		<comments>http://dojo.codegreene.com/2010/01/sharpening-the-blades-document-ready-admins-and-automagic-in-cakephp/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 17:00:07 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=417</guid>
		<description><![CDATA[This edition of Sharpening the Blades features articles about creating admin sections with CakePHP,  how $(document).ready( ) can slow down your site, and the wonderful things CakePHP can do &#8220;automagically.&#8221; Hopefully these articles will help you sharpen your coding blades. Chad, Creating an Admin Section with CakePHP I have come across James blog just recently [...]]]></description>
			<content:encoded><![CDATA[<p>This edition of Sharpening the Blades features articles about creating admin sections with CakePHP,  how $(document).ready( ) can slow down your site, and the wonderful things CakePHP can do &#8220;automagically.&#8221; Hopefully these articles will help you sharpen your coding blades.</p>
<p><strong>Chad</strong>, <a href="http://www.jamesfairhurst.co.uk/posts/view/creating_an_admin_section_with_cakephp_updated">Creating an Admin Section with CakePHP</a><img class="alignright size-full wp-image-424" style="border: 1px solid #444444; margin: 8px 0pt 0px 20px; padding: 2px;" title="cakephp-admin" src="http://dojo.codegreene.com/wp-content/uploads/2010/01/cakephp-admin.jpg" alt="cakephp-admin" width="100" height="100" /><br />
I have come across James blog just recently (about 2 months). The guys blog is great. He does so much with CakePHP that it is great to see what he is doing and what he can do. But the reason I suggest this specific post is because it seems to be the first stumbling block that every developer comes across while using CakePHP. This article specifically will explain how to get an Admin section set up and working. I consider this one of the must needed to know things to develop correctly in CakePHP.</p>
<p><strong>Benjam</strong>,<a href="http://alexsexton.com/?p=22" target="_blank"> Don&#8217;t let Document Ready slow you down</a><img class="alignright size-full wp-image-428" style="border: 1px solid #444444; margin: 8px 0pt 0px 20px; padding: 2px;" title="document-ready" src="http://dojo.codegreene.com/wp-content/uploads/2010/01/document-ready.jpg" alt="document-ready" width="100" height="100" /><br />
Everybody wants to have a faster loading website, and I am certainly guilty of putting every DOM related jQuery snippet into the $(document).ready( ) function.  This post showed me that this wasn&#8217;t absolutely necessary and gives good examples of when and how to break out of the document ready mentality.</p>
<p><strong>Mac, </strong><a href="http://blog.mediarain.com/2009/09/the-dark-side-of-cakephp’s-automagic/" target="_blank">The Dark Side of CakePHP&#8217;s Automagic</a><img class="alignright size-full wp-image-430" style="border: 1px solid #444444; margin: 8px 0pt 0px 20px; padding: 2px;" title="automagic-cakephp" src="http://dojo.codegreene.com/wp-content/uploads/2010/01/automagic-cakephp.jpg" alt="automagic-cakephp" width="100" height="100" /><br />
I&#8217;m not sure I like the title of this article so much as I like the article itself, but it does point out some useful information about the &#8220;automagic&#8221; things that CakePHP does for you. Some of the things they discuss are definitely features that were designed very wisely, even though the article seems to disagree with me on that. There are definitely some automagic things in Cake that they mention that drive me crazy too though, and I don&#8217;t really see the necessity for the seemingly poor decision made by Cake&#8217;s developers. My biggest peeve they mention are the behavior it has (or had, this may have been fixed/changed now) for many-to-many relationships (a.k.a. HABTM). It is really a pain in the neck when your relationship table has other data in it, like the date/time when the relationship was added, or by whom, or a quantity, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2010/01/sharpening-the-blades-document-ready-admins-and-automagic-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

