<?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>Eric Feminella</title>
	<atom:link href="http://www.ericfeminella.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ericfeminella.com/blog</link>
	<description>Thoughts on Software Design and Development</description>
	<lastBuildDate>Tue, 14 Feb 2012 05:21:34 +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>Aptana JavaScript Outline View</title>
		<link>http://www.ericfeminella.com/blog/2012/02/11/aptana-javascript-outline-view/</link>
		<comments>http://www.ericfeminella.com/blog/2012/02/11/aptana-javascript-outline-view/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 03:56:19 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3553</guid>
		<description><![CDATA[Aptana Studio is a great IDE for developing Web Applications. The fact that it is built on Eclipse and completely free leaves little to be desired. That being said, there is one feature I have always found to be lacking, which is, the Outline View for JavaScript. Or, more precisely, the fact that it dosent [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://aptana.com/" target="_blank">Aptana Studio</a> is a great IDE for developing Web Applications. The fact that it is built on Eclipse and completely free leaves little to be desired. That being said, there is one feature I have always found to be lacking, which is, the Outline View for JavaScript. Or, more precisely, the fact that it dosent provide an Outline View when your code is sandboxed within an immediate function.</p>
<p>As it turns out, it actually does; only there is a syntactical caveat to it &#8211; your immediate functions must have the closing parentheses defined outside of the function.</p>
<p>For example, while my preferred tool for validating Javascript is <a href="http://www.jshint.com/" target="_blank">JSHint</a>, the much stricter <a href="http://www.jslint.com/" target="_blank">JSLint</a> requires defining an immediate function&#8217;s invocation (i.e. the closing parentheses) within the function:</p>
<pre class="crayon-plain-tag"><code>
( function(){
}());
  </code></pre>
<p>In JSLint, failing to do so, such as the following:</p><pre class="crayon-plain-tag"><code>
( function(){
})();
  </code></pre><p>
<p>&#8230; results in the following error:</p>
<blockquote><p>Error: Move the invocation into the parens that contain the function.</p></blockquote>
<p>Being somewhat used to conforming to these (arguably unnecessary) rules, after some trial and error I found that adhering to JSLint&#8217;s requirements was in fact the cause of Aptana failing to provide an Outline View.</p>
<p>The solution to this problem is quite simple, just keep the invocation outside of the immediate function and Aptana will display the correct Outline View. Technically, I would consider this a bug on Aptana&#8217;s part and therefore have filed <a href="https://jira.appcelerator.org/browse/APSTUD-4364" target="_blank">APSTUD-4364</a>. Hopefully this issue will be resolved. In the interim, I hope this post helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2012/02/11/aptana-javascript-outline-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One-time function initialization</title>
		<link>http://www.ericfeminella.com/blog/2012/02/04/one-time-function-initialization/</link>
		<comments>http://www.ericfeminella.com/blog/2012/02/04/one-time-function-initialization/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 01:02:42 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3492</guid>
		<description><![CDATA[When developing Mobile Web Applications, even the seemingly marginal micro-optimizations can result in a noticeable performance improvement over time and, therefore should be implemented where possible. One could also argue (and rightly so) that this same principle applies when developing Web Applications on the Desktop; however, in the context of Mobile Web Experiences, such optimizations [...]]]></description>
			<content:encoded><![CDATA[<p>When developing Mobile Web Applications, even the seemingly marginal micro-optimizations can result in a noticeable performance improvement over time and, therefore should be implemented where possible. One could also argue (and rightly so) that this same principle applies when developing Web Applications on the Desktop; however, in the context of Mobile Web Experiences, such optimizations are essential, perhaps even obligatory on the developers part.</p>
<p>In a previous post from a few months back I discussed some of the benefits of <a href="http://www.ericfeminella.com/blog/2011/11/19/function-overwriting-in-javascript/" title="Function Overwriting in JavaScript" target="_blank">function overwriting</a> in JavaScript. One similar performance optimization I regularly employee is that of <em>One-time function initializations</em>.</p>
<p>Conceptually, a <em>One-time function initialization</em> is a rather simple pattern which can be broadly described as follows:</p>
<ol>
<li>An Immediate Function / Self-executing Function performs some initial test conditions.</li>
<li>The Immediate Function returns an anonymous function which, in turn, returns the results of the test conditions. Alternately, the Immediate Function can just return the test condition results.</li>
<li>The anonymous function returned is assigned to a function expression or, the test condition results are assigned directly.</li>
</ol>
<p>An example in code illustrates just how simple this pattern is:</p>
<pre class="crayon-plain-tag"><code>
var hasSomeFeature = ( function() {
    // implement test logic... for example, testing
    // a feature's existence in the browser against
    // multiple vendor prefixes, etc.

    // return a function which returns the results, or
    // just return the result value if desired...
    return function(){
		// return results...
	};
}() );
  </code></pre>
<p>Practical implementation example:</p>
<pre class="crayon-plain-tag"><code>
var hasWebSockets = ( function( window ) 
{
	var prefixes = 'ms O Moz Webkit'.split(' '),
	    n = prefixes.length,
	    i = 0;
	
	for ( ; i &lt; n; ++i ) {
		if ( window[ prefixes[i] + 'WebSocket'] ) {
			return true;
		}
	}
	return 'WebSocket' in window;
}( this ) );
  </code></pre><p>
<p>Implementing <em>One-time function initializations</em> are quite useful in many situations. Specifically, they are of most value when implemented for use-cases where conditions are too complex to assign to a variable directly and, when the conditions tested only need to be evaluated once, after which re-evaluating the condition would be redundant and unnecessary &#8211; such as certain feature detections.</p>
<p>As a general rule of thumb, if a condition or set of conditions can be tested once; that is, they are guaranteed to not change during the execution of the application and, the tests are too complex to maintain if directly assign to a variable, then implementing One-time function initializations are a small, yet simple and practical optimization.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2012/02/04/one-time-function-initialization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AT&amp;T Best Practices Guide for App Development</title>
		<link>http://www.ericfeminella.com/blog/2012/01/15/att-best-practices-guide-for-app-development/</link>
		<comments>http://www.ericfeminella.com/blog/2012/01/15/att-best-practices-guide-for-app-development/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 11:00:20 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Tablets]]></category>
		<category><![CDATA[User Experience Design]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3419</guid>
		<description><![CDATA[When considering the various best practices surrounding the design of Mobile Web Experiences and Architectures, such works as the W3C&#8217;s Mobile Web Application Best Practices guide, or the excellent Mobile Web Best Practices site, and of course, the seminal text, Mobile First, are likely to come to mind. The concepts and strategies presented in these [...]]]></description>
			<content:encoded><![CDATA[<p>When considering the various best practices surrounding the design of Mobile Web Experiences and Architectures, such works as the W3C&#8217;s <a href="http://www.w3.org/TR/mwabp/" target="_blank">Mobile Web Application Best Practices</a> guide, or the excellent <a href="http://mobilewebbestpractices.com/" target="_blank">Mobile Web Best Practices</a> site, and of course, the seminal text, <a href="http://www.abookapart.com/products/mobile-first" target="_blank">Mobile First</a>, are likely to come to mind. The concepts and strategies presented in these works are a staple in the design of many modern Mobile Web Experiences and are without question an invaluable resource. In addition to these and other similarly related works, another new and valuable resource has been made available from a very important player in the Mobile Space indeed &#8211; an actual Wireless Carrier, AT&#038;T.</p>
<p>Recently, I was contacted by a representative of the AT&#038;T Developer Program informing me of the research conducted by the <a href="http://www.research.att.com/editions/201201_home.html?fbid=Mu13IZ0xu2h" target="_blank">AT&#038;T Research Labs</a> and, the subsequent resources made available by AT&#038;T as a result of their findings. Since I was unaware of this work, I was very interesting in learning more and, after reading the introductory statements, I was quite eager to apply AT&#038;T&#8217;s recommendations as well; to quote specifically:<br />
<blockquote>We quickly saw that a few, simple design approaches could significantly improve application responsiveness.</p></blockquote>
<p>Having read through the material in it&#8217;s entirety (provided <a href="#resources" target="_self">below</a>) I must say I am rather impressed. The information provided has very real and practical implications on the design of Mobile Web Applications. Specifically, I found the clear and concise explanation of the underlying implementation of the <a href="http://en.m.wikipedia.org/wiki/Radio_Resource_Control">Radio Resource Control (RRC) protocol</a> to be particularly relevant and useful. RRC is by far one of the most important design factors to consider in terms of battery life and Application responsiveness and, as the research suggests, this may not have been common knowledge. </p>
<p>By far, the most interesting and notable aspect of the AT&#038;T Research Lab&#8217;s work in this area is the fact that all of the information provided is applicable in the context of all Wireless Carriers, not just AT&#038;T. That is, the recommendations given, such as those regarding the RRC State Machine, for example, are all based on carrier-independent standards and protocols implemented by all Wireless Carriers. As such, understanding the implementation specifics and recommendations provided is certain to prove valuable for all users of your Application, regardless of their Carrier.</p>
<p>If you haven&#8217;t all ready, I highly recommend reading and applying the principles provided by AT&#038;T&#8217;s research to your current and future Mobile Web Application Designs.</p>
<h2 id="resources">AT&#038;T Research Labs: Mobile Application Resources</h2>
<p><a href="https://developer.att.com/developer/forward.jsp?passedItemId=7200042" target="_blank">Build Efficient Apps</a><br />
<a href="http://www.research.att.com/export/sites/att_labs/techdocs/TD_100229.pdf" target="_blank">Profiling Resource Usage for Mobile Applications: A Cross-layer Approach</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2012/01/15/att-best-practices-guide-for-app-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring iOS HTTP Monitoring</title>
		<link>http://www.ericfeminella.com/blog/2011/12/16/monitoring-http-traffic-on-ios/</link>
		<comments>http://www.ericfeminella.com/blog/2011/12/16/monitoring-http-traffic-on-ios/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 02:04:29 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[Tablets]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[mobile web]]></category>
		<category><![CDATA[proxies]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3378</guid>
		<description><![CDATA[When developing Web Applications for the Mobile Web Experience it is often useful to have a clear view into all HTTP requests and responses sent between the client and server. This is quite simple to accomplish when developing Web Applications for the Desktop as, the browser is running locally so any standard HTTP Monitor will [...]]]></description>
			<content:encoded><![CDATA[<p>When developing Web Applications for the Mobile Web Experience it is often useful to have a clear view into all HTTP requests and responses sent between the client and server. This is quite simple to accomplish when developing Web Applications for the Desktop as, the browser is running locally so any standard HTTP Monitor will suffice. And, while it is a normal part of a typical development workflow to run an application locally the majority of the time, testing on each target device is obviously an essential part of the process as well.</p>
<p>Luckily, with <a href="http://www.charlesproxy.com/" target="_blank">Charles</a>, on iOS this is quite simple to accomplish.</p>
<h2>Configuration</h2>
<p>To configure Charles to proxy all requests from an iOS device, simply follow these basic steps:</p>
<ol>
<li>From your iOS Device, open Settings.</li>
<li>Go to Wi-Fi, select your Network and select the Blue &#8220;arrow&#8221; icon.</li>
<li>Scroll to HTTP Proxy and select the Manual Button.</li>
<li>In the Server field, enter the IP address of your development machine.</li>
<li>In the port field, enter port 8888 (the default port to which Charles binds).</li>
<li>Leave Authentication set to Off.</li>
</ol>
<p>And that&#8217;s all there is to it. Now, open Mobile Safari and go to your Web Application&#8217;s URL (or any page on the web for that matter). On your development machine, in Charles you will receive a prompt with the IP Address of your Mobile Device, click &#8220;Allow&#8221; and you are all set. When you are done working, make sure to turn off HTTP Proxy on your device.</p>
<h3>Additional Note</h3>
<p>While this article may be focused on Mobile Web Applications, these same configurations apply to all HTTP traffic from any application on your device that requires resources over the web. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/12/16/monitoring-http-traffic-on-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>External Templates in jQote2</title>
		<link>http://www.ericfeminella.com/blog/2011/12/12/external-templates-in-jqote2/</link>
		<comments>http://www.ericfeminella.com/blog/2011/12/12/external-templates-in-jqote2/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 12:00:56 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jqote2]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3315</guid>
		<description><![CDATA[The jQote2 API Reference provides plenty of useful examples which are sure to help users get up and running quickly. I found it a bit unclear, though, as to how templates could be loaded externally as, in the reference examples, templates are defined within the containing page. For the sake of simplicity this approach certainly [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://aefxx.com/api/jqote2-reference/" target="_blank">jQote2 API Reference</a> provides plenty of useful examples which are sure to help users get up and running quickly. I found it a bit unclear, though, as to how templates could be loaded externally as, in the reference examples, templates are defined within the containing page. For the sake of simplicity this approach certainly makes sense in the context of examples. However, in practice, templates would ideally be loaded externally. </p>
<p>While <a href="http://aefxx.com/jquery-plugins/jqote2/" target="_blank">jQote2</a> provides a perfect API for templating, it does not provide a method specifically for loading external templates; this is likely due to the fact that loading external templates could easily be accomplished natively in <a href="http://jquery.com/" target="_blank">jQuery</a>. However, since this is a rather common development use case, having such a facility available would be quite useful.</p>
<p>After reviewing the comments I came across a nice example from <a href="http://aefxx.com/" target="_blank">aefxx</a> (the author of jQote2) which demonstrated a typical approach to loading external templates which was simular to what I had been implementing myself. </p>
<p>And so, I wrote a simple jQuery Plug-in which provides a tested, reusable solution to loading external templates. After having leveraged the Plugin on quite a few different projects, I decided to open source it as others may find it useful as well.</p>
<p>You can grab the source and view the example over on the <a href="https://github.com/efeminella/jqote2-template-loader">jQote2 Template Loader</a> Github page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/12/12/external-templates-in-jqote2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DHTMLX Touch 1.0 Released</title>
		<link>http://www.ericfeminella.com/blog/2011/11/23/dhtmlx-touch-1-0-released/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/23/dhtmlx-touch-1-0-released/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 13:31:56 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Web]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3284</guid>
		<description><![CDATA[Last week, shortly after I blogged about the release of jQuery Mobile 1.0, I received an email informing me of the release of another Mobile Web Framework: DHTMLX Touch 1.0. Being that I was unfamiliar with DHTMLX Touch (as I have been using jQuery Mobile almost exclusively), I was quite interested to learn more; and, [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, shortly after I blogged about the release of <a href="http://www.ericfeminella.com/blog/2011/11/17/jquery-mobile-1-0-released/" target="_blank">jQuery Mobile 1.0</a>, I received an email informing me of the release of another Mobile Web Framework: <a href="http://www.dhtmlx.com/touch/" target="_blank">DHTMLX Touch 1.0</a>. </p>
<p>Being that I was unfamiliar with <em>DHTMLX Touch</em> (as I have been using <a href="http://jquerymobile.com/" target="_blank">jQuery Mobile</a> almost exclusively), I was quite interested to learn more; and, having tried the <a href="http://www.dhtmlx.com/touch/samples/" target="_blank">Examples</a> and reviewed the <a href="http://docs.dhtmlx.com/touch/" target="_blank">Documentation</a>, I was rather impressed by DHTMLX Touch. </p>
<p>And so, if you haven&#8217;t already, <a href="http://www.dhtmlx.com/blog/?p=1425" target="_blank">check it out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/23/dhtmlx-touch-1-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Function Overwriting in JavaScript</title>
		<link>http://www.ericfeminella.com/blog/2011/11/19/function-overwriting-in-javascript/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/19/function-overwriting-in-javascript/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 19:45:40 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3129</guid>
		<description><![CDATA[Whether intentional, or simply a by-product of it&#8217;s design, Javascript, being a dynamic language, allows for a level of expressiveness which most any seasoned programmer would come to appreciate. Javascript naturally provides the ability to implement some rather intriguing and quite unique patterns; one of which is the ability to overwrite a function at runtime. [...]]]></description>
			<content:encoded><![CDATA[<p>Whether intentional, or simply a by-product of it&#8217;s design, Javascript, being a <a href="http://en.wikipedia.org/wiki/Dynamic_programming_language" target="_blank">dynamic language</a>, allows for a level of expressiveness which most any seasoned programmer would come to appreciate. Javascript naturally provides the ability to implement some rather intriguing and quite unique patterns; one of which is the ability to overwrite a function at runtime.</p>
<section>
<h2>Function Overwriting</h2>
<p><em>Function Overwriting</em> (also known as &#8220;Self-Defining Functions&#8221; or &#8220;Lazy Defining Functions&#8221;) provides a pattern which, as stated above, allows for overwriting a function&#8217;s definition at runtime. This can be accomplished from outside of the function, but also from within the function&#8217;s implementation itself.</p>
<p>For example, on occasion a function may need to perform some initial piece of work, after which, all subsequent invocations would result in unnecessarily re-executing the initialization code. Typically, this issue is addressed by storing initialization flags or refactoring the initialization code to another function. While such a design solves this problem, it does result in unnecessary code which will need to be maintained. In JavaScript, perhaps a different approach is in order: we can simply redefine the function after the initialization work has been completed.</p>
<p>A possible candidate use-case for Function Overwriting is Feature Detection as, detecting for specific feature support in the Browser typically only needs to be tested once, at which point subsequent tests are unnecessary.</p>
<p>Below is a basic example of implementing <em>Function Overwritting</em> in the context of an abstraction of the <a href="http://dev.w3.org/geo/api/spec-source.html" title="HTML5 Geolocation" target="_blank">HTML5 Geolocation</a> API.</p>
<pre class="crayon-plain-tag"><code>
// Initial &quot;getLocation&quot; implementation. Since we only need to test
// for Geolocation support once, we perform the initial test and then
// overwrite the &quot;getLocation&quot; implementation based on the results of
// the test.
var getLocation = function ( success, fail, options )
{
	var geolocation = navigator.geolocation;

	if ( geolocation )
	{
		var _options = {
			enableHighAccuracy : true,
			timeout            : 60000,
			maximumAge         : 0
		};
        // Geolocation is supported, so we overwrite the implementation
        // to simply invoke &quot;geolocation.getCurrentPosition&quot; as there 
        // is no need to perform the test again.
        getLocation = function (success, fail, options)
        {
            geolocation.getCurrentPosition ( success, 
                    fail, 
                    options || _options);
        }
        getLocation( success, fail, options );
	}
	else 
	{
	    // Geolocation is not supported, so we overwrite the 
        // implementation to simply return false (a real 
	    // implementation might provide a polyfill here...).
	    getLocation = function ()
	    {
            return false;
        }
    }		
};
  </code></pre>
</section>
<section>
<h2>Considerations</h2>
<p>Since functions are objects in Javascript, it is important to keep in mind that if you add a property or method to a function (either statically or via the function&#8217;s prototype), and then overwrite the function, you will have effectively removed those properties or methods as well. Also, if the function is referenced by another variable, or by a method of another object, the initially defined implementation will be preserved and the overwriting process will not occur. As such, be mindful when implementing this pattern. As a general rule of thumb, I typically only implement Function Overwriting when the function being redefined is in a private scope.<br />
</section>
<section>
<h2>Concluding Thoughts</h2>
<p>As you can see, Function Overwriting provides a convenient facility for optimizing code execution at runtime. There are many use-cases for dynamically overwriting functions and, where appropriate, they can certainly provide value in terms of performance and code maintainability.</p>
<p>Below you can find an example which demonstrates two basic <em>Function Overwriting</em> implementations. Simply load the page and add some breakpoints in Firebug to test the execution paths; both before and after overwriting each function occurs, or you can simply view the source.<br />
<a href="http://code.ericfeminella.com/articles/examples/js/function-overwritting/" title="Function Overwriting Example" target="_blank">Example</a><br />
</section>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/19/function-overwriting-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refreshing listviews in jQuery Mobile</title>
		<link>http://www.ericfeminella.com/blog/2011/11/18/jquery-mobile-listviewrefresh/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/18/jquery-mobile-listviewrefresh/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 03:42:01 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Mobile]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3168</guid>
		<description><![CDATA[When dynamically creating or updating a list in jQuery Mobile; either via AJAX or by other means, one must take care to explicitly invoke the target listview widget to &#8220;refresh&#8221; in order to instruct the framework to apply the augmented markup and styles to the corresponding elements of the underlying list. For example, consider the [...]]]></description>
			<content:encoded><![CDATA[<p>When dynamically creating or updating a <code>list</code> in jQuery Mobile; either via AJAX or by other means, one must take care to explicitly invoke the target <a href="https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.listview.js" target="_blank">listview widget</a> to <em>&#8220;refresh&#8221;</em> in order to instruct the framework to apply the augmented markup and styles to the corresponding elements of the underlying list.</p>
<p>For example, consider the following simplified example which creates an <code>li</code> element for each item in an <code>Array</code>:</p><pre class="crayon-plain-tag"><code>
var list = &quot;&quot;,
    items = [{name: &quot;Item A&quot;, url: &quot;/#item-a&quot;}, 
             {name: &quot;Item B&quot;, url: &quot;/#item-b&quot;}, 
             {name: &quot;Item C&quot;, url: &quot;/#item-c&quot;}];

$.each( items, function( i, item ) {
    list += '&lt;li&gt;&lt;a href=&quot;' + item.url + '&quot;&gt;';
    list += item.name;
    list += '&lt;/a&gt;&lt;/li&gt;';
});
$(&quot;ul:jqmData(role='listview')&quot;).append( list );
  </code></pre>
<p>While this will create the list items and add them to the target <code>listview</code> <code>ul</code> element, JQM will not auto enhance the newly added items unless instructed to do so. I imagine this is due to a necessary design decision as, constantly monitoring the DOM for changes would certainly incur a performance hit.</p>
<p>In order to correct this, we just need to invoke <code>.listview("refresh");</code> after appending the new elements to the list. This will notify <em>JQM</em> to apply the expected enhancements. And so, the following example will result in the expected list enhancements being applied:</p><pre class="crayon-plain-tag"><code>
var list = &quot;&quot;,
    items = [{name: &quot;Item A&quot;, url: &quot;/#item-a&quot;}, 
             {name: &quot;Item B&quot;, url: &quot;/#item-b&quot;}, 
             {name: &quot;Item C&quot;, url: &quot;/#item-c&quot;}];

$.each( items, function( i, item ) {
    list += '&lt;li&gt;&lt;a href=&quot;' + item.url + '&quot;&gt;';
    list += item.name;
    list += '&lt;/a&gt;&lt;/li&gt;';
});
$(&quot;ul:jqmData(role='listview')&quot;).append( list ).listview(&quot;refresh&quot;);
  </code></pre><p>
<p>You can try an example which demonstrates both of the above implementations <a href="http://code.ericfeminella.com/articles/examples/jqm/listview/index.html" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/18/jquery-mobile-listviewrefresh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Mobile 1.0 Released</title>
		<link>http://www.ericfeminella.com/blog/2011/11/17/jquery-mobile-1-0-released/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/17/jquery-mobile-1-0-released/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 16:45:20 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tablets]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jqm]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jQuery Mobile]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[mobile web]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=2903</guid>
		<description><![CDATA[Today, the jQuery Mobile Team announced the official release of jQuery Mobile 1.0. Having worked with jQuery Mobile since Alpha 1, in the time since, the framework has certainly evolved into a mature, premier platform on which Mobile Web Applications can be built. On a personal note, as I am currently in the process of [...]]]></description>
			<content:encoded><![CDATA[<p><time datetime="2011-11-17">Today</time>, the jQuery Mobile Team announced the official release of <a href="http://jquerymobile.com/blog/2011/11/16/announcing-jquery-mobile-1-0/" target="_blank">jQuery Mobile 1.0</a>. </p>
<p>Having worked with jQuery Mobile since <a href="http://jquerymobile.com/demos/1.0a1/" target="_blank">Alpha 1</a>, in the time since, the framework has certainly evolved into a mature, premier platform on which Mobile Web Applications can be built. </p>
<p>On a personal note, as I am currently in the process of working towards the release of a multi form-factor Mobile Web Application built on jQuery Mobile, the <em>1.0</em> release couldn&#8217;t have come at a better time.</p>
<p>Be sure to check out the updated <a href="http://jquerymobile.com/demos/1.0/" title="jQuery Mobile 1.0 API Documentation" target="_blank">API Docs</a>, especially the new <a href="http://jquerymobile.com/test/docs/api/data-attributes.html" target="_blank">Data Attributes</a> section.</p>
<p>jQuery Mobile 1.0 represents a <strong>significant milestone</strong> in the <em>Mobile Web Space</em>. I am certainly excited to see what is on the roadmap next.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/17/jquery-mobile-1-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Combinators</title>
		<link>http://www.ericfeminella.com/blog/2011/11/13/css3-combinators/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/13/css3-combinators/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 11:51:52 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[css3 combinators]]></category>
		<category><![CDATA[CSS3 Selectors]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[selectors]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3016</guid>
		<description><![CDATA[In my previous article on CSS3 Selectors, I discussed the two Attribute Selector classifications; Attribute Presence and Value Selectors, and, Attribute Substring Matching Selectors. In addition to the new Attribute Selectors, the CSS3 Selectors Module defines a new Combinator called the General sibling combinator, which is described below, succeeding a review of each CSS3 Combinator. [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous article on CSS3 Selectors, I discussed the two <em>Attribute Selector</em> classifications; <a href="http://http://www.ericfeminella.com/blog/2011/11/10/css3-attribute-selectors/#attribute-presence-value-selectors" target="_blank">Attribute Presence and Value Selectors</a>, and, <a href="http://www.ericfeminella.com/blog/2011/11/10/css3-attribute-selectors/#attribute-substring-matching-selectors" target="_blank">Attribute Substring Matching Selectors</a>.</p>
<p>In addition to the new Attribute Selectors, the <a href="http://www.w3.org/TR/css3-selectors/" target="_blank">CSS3 Selectors Module</a> defines a new <em>Combinator</em> called the <strong>General sibling combinator</strong>, which is described below, succeeding a review of each CSS3 <em>Combinator</em>.</p>
<section>
<h2>Combinators</h2>
<p>Combinators provide a means for describing relationships between elements in order to &#8220;combine&#8221; them to form specific rules based on a simple syntax. There are four Combinators in CSS3, below is description and example of each:</p>
<div class="post-datalist">
<dl>
<dt>Descendant combinator</dt>
<dd>The most familiar of all Combinators, the <em>Descendant combinator</em> allows for selecting any element <em>f</em> which is a descendant (child, grandchild, great-grandchild and so on) of an element <em>e</em>. The combinator syntax for a Descendant combinator is a single &#8220;white-space&#8221; character.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all &lt;h1&gt; elements which are descendants of an &lt;article&gt; element */
article h1{
    /* declarations */
}</code></pre><br />
<a href="http://www.w3.org/TR/selectors/#descendant-combinators" target="_blank">8.1. Descendant combinator</a>
</dd>
<dt>Child combinators</dt>
<dd><em>Child combinators</em> allow for selecting any element <em>f</em> which is a direct child of an element <em>e</em>. The combinator syntax for a <em>Child combinator</em> is a single &#8220;greater-than&#8221; (&gt;) sign.<br />
<pre class="crayon-plain-tag"><code>
/* Matches each &lt;section&gt; element that is a direct child of an &lt;article&gt; element */
article &gt; section {
    /* declarations */
}</code></pre><br />
<a href="http://www.w3.org/TR/selectors/#child-combinators" target="_blank">8.2. Child combinator</a>
</dd>
<dt>Adjacent sibling combinator</dt>
<dd>The <em>Adjacent sibling combinator</em> is a <em>Sibling combinator</em> which allows for selecting an element <em>f</em> which is adjacent to an element <em>e</em>; that is, element <em>f</em> immediately follows element <em>e</em> in the document tree. The combinator syntax for an <em>Adjacent sibling combinator</em> is a single &#8220;plus&#8221; (+) sign.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all &lt;em&gt; elements which are the next sibling of a &lt;strong&gt; element */
strong + em {
	/* declarations */
}</code></pre><br />
<a href="http://www.w3.org/TR/selectors/#adjacent-sibling-combinators" target="_blank">8.3.1. Adjacent sibling combinator</a>
</dd>
<dt>General sibling combinator</dt>
<dd>New in CSS3, the <em>General sibling combinator</em> is similar to the <em>Adjacent sibling combinator</em> in that it matches an element <em>f</em> which follows an element <em>e</em> in the document tree; however, whereas in the <em>Adjacent sibling combinator</em> element <em>f</em> must immediately follow element <em>e</em>, the <em>General sibling combinator</em> allows for selecting an element <em>f</em> which is preceded by an element <em>e</em>, but not necessarily immediately preceded by an element <em>e</em>. The combinator syntax for a <em>General sibling combinator</em> is a single &#8220;tilde&#8221; (~) sign.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all &lt;time&gt; elements which are preceded by a &lt;del&gt; element */
del ~ time {
    /* declarations */
}</code></pre><br />
<a href="http://www.w3.org/TR/selectors/#general-sibling-combinators" target="_blank">8.3.2. General sibling combinator</a>
</dd>
</dl>
<p>The following link provides a (rather crude in terms of design) example of each Combinator described above:<br />
<a href="http://code.ericfeminella.com/articles/examples/css3/selectors/combinators.html" target="_blank" title="CSS3 Combinators Example">View Example</a>
</div>
</section>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/13/css3-combinators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Attribute Selectors</title>
		<link>http://www.ericfeminella.com/blog/2011/11/10/css3-attribute-selectors/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/10/css3-attribute-selectors/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 15:59:33 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[CSS3 Attribute Selectors]]></category>
		<category><![CDATA[CSS3 Selectors]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 elements]]></category>
		<category><![CDATA[html5 semantics]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=2937</guid>
		<description><![CDATA[The power of CSS Selectors can not be understated; for, without them, there would be no simple means by which developers could target specific elements for styling in a manner abstracted from, or external to, the actual markup to which the styles will bind. In addition to some of the more common Simple Selectors, such [...]]]></description>
			<content:encoded><![CDATA[<p>The power of <a href="http://www.w3.org/TR/selectors/" title="CSS3 Selectors Module" target="_blank">CSS Selectors</a> can not be understated; for, without them, there would be no simple means by which developers could target specific elements for styling in a manner abstracted from, or external to, the actual markup to which the styles will bind.</p>
<p>In addition to some of the more common <a href="http://www.w3.org/TR/selectors/#simple-selectors" title="CSS3 Simple Selectors" target="_blank">Simple Selectors</a>, such as <a href="http://www.w3.org/TR/selectors/#type-selectors" title="CSS3 Type Selectors" target="_blank">Type Selectors</a>, <a href="http://www.w3.org/TR/selectors/#class-html" title="CSS3 Class Selectors" target="_blank">Class Selectors</a> and <a href="http://www.w3.org/TR/selectors/#id-selectors" title="CSS3 Id Selectors" target="_blank">Id Selectors</a>, we have have <a href="http://www.w3.org/TR/selectors/#attribute-selectors" title="CSS3 Attribute Selectors" target="_blank">Attribute Selectors</a>, which, as the name implies, allow us to match elements based on their <a href="http://dev.w3.org/html5/spec/Overview.html#attributes" title="HTML5 Element Attributes" target="_blank">attributes</a>.</p>
<section id="attribute-presence-value-selectors">
<h2>Attribute Presence and Value Selectors</h2>
<p>CSS2 introduced four Attribute Selectors; referred to as <em>Attribute Presence and Value Selectors</em>, which allow for course grained matching of specific elements based on their attributes and / or attribute values. These include the following:</p>
<div class="post-datalist">
<dl>
<dt>e[attr]</dt>
<dd>Where <em>e</em> is an element and <code>[attr]</code> is an attribute of element <em>e</em>. For example, <code>p[title]</code> would match all <code>p</code> tags with a <code>title</code>, regardless of the value of the <code>title</code>.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all &lt;p&gt; tags with a title and changes their background color to red with white text */
p[title]{
    background-color: red;
    color: white;
}</code></pre><p></dd>
<dt>e[attr=val]</dt>
<dd>Where <em>e</em> is an element and <code>[attr=val]</code> represent an attribute of element <em>e</em> which contains the exact value of <code>val</code>. For example, <code>p[title="Example 1"]</code> would match all <code>p</code> tags with a <code>title</code> which equals &#8220;Example 1&#8243; exactly.</p><pre class="crayon-plain-tag"><code>
/* Matches all &lt;p&gt; tags with a title equal to &quot;Example 1&quot; and changes their background color to green and text color to white */
p[title=&quot;Example 1&quot;]{
    background-color: green;
    color: white;
}</code></pre><p><p>
</dd>
<dt>e[attr~=val]</dt>
<dd>Where <em>e</em> is an element and <code>[attr~=val]</code> is an attribute of element <em>e</em> which has a value containing a whitespace-separated list of words, one of which equals <code>val</code> exactly. For example, <code>p[title~="Example-1a"]</code> would match all <code>p</code> tags with a <code>title</code> containing the word &#8220;Example-1a&#8221; in a list of whitespace delimited words.</p><pre class="crayon-plain-tag"><code>
/* Matches all &lt;p&gt; tags with a title containing the exact word to &quot;Example-1a&quot; and changes their background color to black and text color to red */
p[title~=&quot;Example-1a&quot;]{
    background-color: black;
    color: red;
}</code></pre><p><p><p>
</dd>
<dt>e[attr|=val]</dt>
<dd>Where <em>e</em> is an element and <code>[attr|=val]</code> is an attribute of element <em>e</em> that has a value of <code>val</code> exactly, or begins with <code>val</code> immediately followed by a hyphen &#8220;-&#8221;. For example, <code>p[title!="Example"]</code> would match all <code>p</code> tags with a <code>title</code> containing the word &#8220;Example-&#8221;, followed by any other value, such as &#8220;Example-1&#8243;, &#8220;Example-A&#8221;, etc..</p><pre class="crayon-plain-tag"><code>
/* Matches all &lt;p&gt; tags with a title containing the word to &quot;Example-&quot; and changes their background color to blue and text color to white */
p[title|=&quot;Example&quot;]{
    background-color: blue;
    color: white;
}</code></pre><p><p><p><p>
</dd>
</dl>
<p><a href="http://code.ericfeminella.com/articles/examples/css3/selectors/attribute-presence.html" target="_blank" title="Attribute Presence and Value Selectors Example">View Example</a>
</div>
</section>
<section id="attribute-substring-matching-selectors">
<h2>Substring Matching Attribute Selectors</h2>
<p>In addition to the above <em>Attribute Presence and Value Selectors</em>, CSS3 expands on this by defining three additional <a href="http://www.w3.org/TR/selectors/#attribute-substrings" target="_blank">Attribute Selectors</a>; referred to as <em>Substring Matching Attribute Selectors</em>. These additions allow for fine grained matching of specific elements based on their attribute values.</p>
<p>In simplest terms, the new Attribute Selectors in CSS3 can be used to match an element with a given attribute whose value begins, ends or contains a certain value. The following is a basic description and example of each new Attribute Selector:</p>
<div class="post-datalist">
<dl>
<dt>e[attr^=val]</dt>
<dd>Where <em>e</em> is an element and <code>[attr^=val]</code> is an attribute of element <em>e</em> which contains a value that begins with <em>val</em>.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all linked resources sent over https */
a[href^=&quot;https&quot;]{
    color: red;
}</code></pre>
</dd>
<dt>e[attr$=val]</dt>
<dd>Where <em>e</em> is an element and <code>[attr$=val]</code> represent an attribute of element <em>e</em> which contains a value that ends with <code>val</code>.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all anchor tags to .html documents */
a[href$=&quot;.html&quot;]{
    color: green;
}</code></pre>
</dd>
<dt>e[attr*=val]</dt>
<dd>Where <em>e</em> is an element and <code>[attr*=val]</code> is an attribute of element <em>e</em> which has a value that contains <code>val</code>.<br />
<pre class="crayon-plain-tag"><code>
/* Matches all anchor tags which contain a query string */
a[href*=&quot;?&quot;]{
    color: blue;
}</code></pre>
</dd>
</dl>
<p><a href="http://code.ericfeminella.com/articles/examples/css3/selectors/substring-matching.html" target="_blank" title="Substring Matching Attribute Selectors Example">View Example</a>
</div>
</section>
<p>To summarize, there are a total of seven Attribute Selectors in CSS3, three of which are new. Whether used for general matches, such as global Attributes; e.g. <code>*[hreflang|=en]</code> or more specific matches, such as chaining; e.g, <code>a[href^="https"][target="_blank"]</code>, Attribute Selectors provide a powerful mechanism for selecting both general and specific content within a page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/10/css3-attribute-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 selection pseudo-element (dropped)</title>
		<link>http://www.ericfeminella.com/blog/2011/11/02/css3-selection-colors/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/02/css3-selection-colors/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 06:23:32 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[UI design]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2011/10/25/css3-selection-colors/</guid>
		<description><![CDATA[With both the CSS3 Selectors and CSS3 Namespaces Modules, respectively, having been released as official W3C recommendations (Selectors, Namespaces), I felt compelled to re-review each specification. Interestingly, while reviewing the CSS3 Selectors Module (my personal favorite), I noticed that the selection pseudo-element selector which was originally drafted for CSS3 had been dropped from the proposal. [...]]]></description>
			<content:encoded><![CDATA[<p>With both the <a href="http://www.w3.org/TR/css3-selectors/" target="_blank">CSS3 Selectors</a> and <a href="http://www.w3.org/TR/css3-namespace/" target="_blank">CSS3 Namespaces</a> Modules, respectively, having been released as official W3C recommendations (<cite><a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/" target="_blank">Selectors</a>, <a href="http://www.w3.org/TR/2011/REC-css3-namespace-20110929/" target="_blank">Namespaces</a></cite>), I felt compelled to re-review each specification.</p>
<p>Interestingly, while reviewing the CSS3 Selectors Module (my personal favorite), I noticed that  the <code><a href="http://www.w3.org/TR/css3-selectors/#selection" target="_blank">selection</a></code> pseudo-element selector which was originally drafted for CSS3 had been dropped from the proposal. In fact, it was dropped a rather long time ago.</p>
<p>In case you are not familiar with the <code>selection</code> pseudo-element, essentially it allows for defining the text <code>color</code> and <code>background-color</code> of selected text within a document.</p>
<p>For example, all <code>&lt;code&gt;</code> elements on my site have a red background with white text when selected &#8211; <code>such as this text here (select it)</code> &#8211; based on the following two simple rules:</p><pre class="crayon-plain-tag"><code>
// IE, Chrome, Safari, Opera
code::selection { background: #ca3131; color:#fff; }
code::-moz-selection { background: #ca3131; color:#fff; }
  </code></pre>
<p>And so, while having been dropped, support is already rather good (FF3.6, SA3.1+, OP9.5+, CH2+, IE9) and as far as I am aware Browser vendors will continue to <cite><a href="https://developer.mozilla.org/En/CSS/%3A%3Aselection" target="_blank">support ::selection</a></cite>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/02/css3-selection-colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

