<?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>Ajax Bestiary &#187; Article</title>
	<atom:link href="http://www.ajaxbestiary.com/tag/article/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxbestiary.com</link>
	<description>AJAX Development, News, Techniques &#38; More</description>
	<lastBuildDate>Sat, 19 Jun 2010 13:43:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cross Site Scripting &#8211; the new old way</title>
		<link>http://www.ajaxbestiary.com/2009/10/20/cross-site-scripting-the-new-old-way/</link>
		<comments>http://www.ajaxbestiary.com/2009/10/20/cross-site-scripting-the-new-old-way/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:02:35 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=361</guid>
		<description><![CDATA[

Cross Site Scripting (XSS) is a big security no-no. It’s never supposed to happen, because as we all know, any script operating within your page has full access to the entire DOM of the page.
Then again, there is so much functionality that we want to implement without reinventing the wheel. Marketing departments want to use [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Cross Site Scripting (XSS) is a big security no-no. It’s never supposed to happen, because as we all know, any script operating within your page has full access to the entire DOM of the page.</p>
<p>Then again, there is so much functionality that we want to implement without reinventing the wheel. Marketing departments want to use third-party tracking tools. The IT folks want to distribute the load for our network heavy site across the third-level domains www.domain.com, static.domain.com and data.domain.com. And users want more functionality than we can hope to provide on our own.</p>
<p>So resigned to the reality that XSS is a legitimate necessity, we need a way to do it. The old way (as far back as the mid-90’s, in fact) was straightforward:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>‘<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span>”JavaScript” type<span style="color: #339933;">=</span>”text<span style="color: #339933;">/</span>javascript” src<span style="color: #339933;">=</span>”http<span style="color: #339933;">:</span><span style="color: #006600; font-style: italic;">//data.domain.com/myscript.js”&gt;&lt;/script&gt;’);</span></pre></div></div>

<p></code></p>
<p>This is of course problematic as it treats DOM nodes improperly and may not even get processed by modern browsers. Instead, jQuery provides access to JSONP which will do the same thing – insert a new script node in the DOM – but do it in an XHTML compliant way.</p>
<p>Accessing JSONP is pretty straightforward:</p>
<p><code</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://data.domain.com/myscript&amp;callback=?”, inPageFunction);</span></pre></div></div>

<p></code></p>
<p>The key bit is &amp;callback=? – this causes jQuery to insert a script node into the DOM, which is then immediately executed and returned to the callback function, inPageFunction, like so:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">inPageFunction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>data<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;foo&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p></code></p>
<p>If you forget &amp;callback=? you’ll get the error Access to restricted URI denied. And yes, since we’re inserting a script node, we’re limited to GET requests. And if the call fails, you’ll simply get nothing back – no useful error messages.</p>
<p>Further, the next generation of browsers is coming out with integrated support for cross site XMLHttpRequest, but since when have we not had to code to support multiple versions of browsers?</p>
<p>There are loads of good guides to expand your knowledge:</p>
<ul>
<li><a href="http://www.insideria.com/2009/03/what-in-the-heck-is-jsonp-and.html">What the heck is JSONP and why should you use it?</a></li>
<li><a href="http://niryariv.wordpress.com/2009/05/05/jsonp-quickly/">JSONP, Quickly</a></li>
<li><a href="http://www.ibm.com/developerworks/library/wa-aj-jsonp1/">Cross-domain communications with JSONP</a>, Part 1</li>
<li><a href="http://www.ibm.com/developerworks/web/library/wa-aj-jsonp2/index.html">Cross-domain communications with JSONP</a>, Part 2</li>
</ul>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/10/20/cross-site-scripting-the-new-old-way/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Implicit Vs. Explicit Conversion in Javascript</title>
		<link>http://www.ajaxbestiary.com/2008/01/14/implicit-vs-explicit-conversion-in-javascript/</link>
		<comments>http://www.ajaxbestiary.com/2008/01/14/implicit-vs-explicit-conversion-in-javascript/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 13:13:59 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tips & tricks]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2008/01/14/implicit-vs-explicit-conversion-in-javascript/</guid>
		<description><![CDATA[

A question emerged out of my boredom on my flight yesterday.  Which is faster, implicit vs explicit conversion.  Most javascript developers use implicit conversion out of habit. For example:
!!x; instead of Boolean( x ); and x + &#8220;&#8221;; instead of String( x);.  
I decided to try an experiment for myself and record the performance of [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>A question emerged out of my boredom on my flight yesterday.  Which is faster, implicit vs explicit conversion.  Most javascript developers use implicit conversion out of habit. For example:</p>
<p>!!x; instead of Boolean( x ); and x + &#8220;&#8221;; instead of String( x);.  </p>
<p>I decided to try an experiment for myself and record the performance of casting a number to a Boolean or String on my Windows box in Safari 3, Firefox 2, Opera 9 and IE 7.</p>
<p><strong>The Verdict:</strong></p>
<p>Implicit conversion wins handily, demonstrating over a 7 fold performance increase in one test. Overall, the performance gain for using implicit conversion averaged out to 53% across browsers after 10 tests. </p>
<p><strong>The Numbers: </strong></p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="112"> </td>
<td valign="top" width="53">Implicit Boolean</td>
<td valign="top" width="80">Explicit Boolean</td>
<td valign="top" width="75">Implicit String</td>
<td valign="top" width="74">Explicit String</td>
</tr>
<tr>
<td valign="top" width="112">Firefox 2</td>
<td valign="top" width="53">0.162</td>
<td valign="top" width="80">0.312</td>
<td valign="top" width="74">0.248</td>
<td valign="top" width="74">0.358</td>
</tr>
<tr>
<td valign="top" width="112">IE 7</td>
<td valign="top" width="53">0.042</td>
<td valign="top" width="80">0.100</td>
<td valign="top" width="74">0.074</td>
<td valign="top" width="74">0.152</td>
</tr>
<tr>
<td valign="top" width="112">Opera 9</td>
<td valign="top" width="53">0.030</td>
<td valign="top" width="80">0.088</td>
<td valign="top" width="74">0.020</td>
<td valign="top" width="74">0.142</td>
</tr>
<tr>
<td valign="top" width="112">Safari 3</td>
<td valign="top" width="53">0.028</td>
<td valign="top" width="80">0.036</td>
<td valign="top" width="74">0.074</td>
<td valign="top" width="74">0.100</td>
</tr>
<tr>
<td valign="bottom" width="112"><em>Cross Browser Average</em></td>
<td valign="bottom" width="53"><em>0.066</em></td>
<td valign="bottom" width="81"><em>0.134</em></td>
<td valign="bottom" width="75"><em>0.104</em></td>
<td valign="bottom" width="75"><em>0.188</em></td>
</tr>
</tbody>
</table>
<p>You can find the code I used after the jump.</p>
<p><span id="more-309"></span></p>
<p><strong>The Code:</strong></p>
<p>&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221;&gt;<br />&lt;html&gt;<br />  &lt;head&gt;<br />  &lt;meta http-equiv=&#8221;content-type&#8221; content=&#8221;text/html; charset=windows-1250&#8243;&gt;<br />  &lt;meta name=&#8221;generator&#8221; content=&#8221;PSPad editor, www.pspad.com&#8221;&gt;<br />  &lt;title&gt;&lt;/title&gt;<br />  &lt;script type=&#8221;text/javascript&#8221;&gt;<br />  // JavaScript Document</p>
<p>var implicitBoolean, explicitBoolean, implicitString, explicitString, startDate, endDate;</p>
<p>implicitBoolean = explicitBoolean = implicitString = explicitString = 0;</p>
<p>for( i = 0; i &lt; 500; i++ ){</p>
<p>startDate= new Date();<br />for( i=0; i &lt; 32000; i++){ Boolean( i );} <br />endDate = new Date();<br />explicitBoolean += ( endDate &#8211; startDate );<br />startDate= new Date();<br />for( i=0; i &lt; 32000; i++){ !!i;} <br />endDate = new Date();<br />implicitBoolean += ( endDate &#8211; startDate );</p>
<p>startDate= new Date();<br />for( i=0; i &lt; 32000; i++){ String( i );} <br />endDate = new Date();<br />explicitString += ( endDate &#8211; startDate );</p>
<p>startDate= new Date();<br />for( i=0; i &lt; 32000; i++){ i + &#8220;&#8221;;} <br />endDate = new Date();<br />implicitString += ( endDate &#8211; startDate );<br />}</p>
<p>document.writeln( &#8220;Implicit Boolean:  &#8221; + (implicitBoolean / 500 ) + &#8220;&lt;br /&gt;&#8221; );<br />document.writeln( &#8220;Explicit Boolean:  &#8221; + (explicitBoolean / 500 ) + &#8220;&lt;br /&gt;&#8221; );<br />document.writeln( &#8220;Implicit String:  &#8221; + (implicitString / 500 ) + &#8220;&lt;br /&gt;&#8221; );<br />document.writeln( &#8220;Explicit String:  &#8221; + (explicitString / 500 ) + &#8220;&lt;br /&gt;&#8221; );<br />  &lt;/script&gt;<br />  &lt;/head&gt;<br />  &lt;body&gt;</p>
<p>  &lt;/body&gt;<br />&lt;/html&gt;</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/01/14/implicit-vs-explicit-conversion-in-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Taking the Web to the Desktop, Part 2: Mobile Sites</title>
		<link>http://www.ajaxbestiary.com/2008/01/04/taking-the-web-to-the-desktop-part-2-mobile-sites/</link>
		<comments>http://www.ajaxbestiary.com/2008/01/04/taking-the-web-to-the-desktop-part-2-mobile-sites/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 19:06:13 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Desktop]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2008/01/04/taking-the-web-to-the-desktop-part-2-mobile-sites/</guid>
		<description><![CDATA[

I know what you&#8217;re thinking, mobile aps run on cellphones and smartphones, not PC&#8217;s.  Mobile sites are one of the most important and pervasive aspects of this hybrid web ecosystem.  Unlike desktops and laptops, mobile sites can assume that the cellular device they are displayed on will have a persistent and portable net [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>I know what you&#8217;re thinking, mobile aps run on cellphones and smartphones, not PC&#8217;s.  Mobile sites are one of the most important and pervasive aspects of this hybrid web ecosystem.  Unlike desktops and laptops, mobile sites can assume that the cellular device they are displayed on will have a persistent and portable net connection.  Because of this benefit, mobile sites can be viewed as intermediaries to be used with a user may not have access to a traditional internet connection.</p>
<p>Unfortunately, mobile platforms are and always will be limited devices.  There simply is no way to put all of the screen real estate of even the smallest monitor into a device that will fit into someones pocket without resorting to origami voodoo.  Higher screen resolutions help the situation, but there are limits to the human visual system and 6pt font is almost as eligible on paper as it is on any digital screen.</p>
<p>Other restrictions abound surrounding the mobile platform.  From a user interface perspective it&#8217;s still a bit of the wild west and mobile browsers have tended to be flaky, inconsistent and underpowered.  Safari, Opera and Minimo make significant strides towards eliminating these issues and providing a much richer platform on which to develop.  Many cellphones also provide API&#8217;s to enable mobile aps to look consistent with, act like and interface with the underlying device.</p>
<p>The inconsistencies across platforms still make mobile devices a difficult nut to crack in terms of development.  As browsers, bandwidth and processing power improves, expect developing for them to increasingly less frustrating and in higher demand from users.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/01/04/taking-the-web-to-the-desktop-part-2-mobile-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great Article on Ajax Interface Construction &amp; Best Practices</title>
		<link>http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 13:40:01 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Best Practices]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/</guid>
		<description><![CDATA[

IBM Developer Works has released an excellent article on AJAX interface development with a focus on best practices and a recomended work flow.
Check it out here:
http://www.ibm.com/developerworks/web/library/wa-aj-frontend/index.html?ca=drs-tp4207


]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>IBM Developer Works has released an excellent article on AJAX interface development with a focus on best practices and a recomended work flow.</p>
<p>Check it out here:</p>
<p><a href="http://www.ibm.com/developerworks/web/library/wa-aj-frontend/index.html?ca=drs-tp4207">http://www.ibm.com/developerworks/web/library/wa-aj-frontend/index.html?ca=drs-tp4207</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Standardizing On A Framework</title>
		<link>http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 19:56:06 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/</guid>
		<description><![CDATA[

Organizational standards are wonderful things.  They enforce consistency, help insure institutional competence and can dramatically reduce the learning curve to get additional staff up to speed on a project.  At the same time, in the world of AJAX standards can be too slow to adapt to a constantly changing landscape.  How do you strike a [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Organizational standards are wonderful things.  They enforce consistency, help insure institutional competence and can dramatically reduce the learning curve to get additional staff up to speed on a project.  At the same time, in the world of AJAX standards can be too slow to adapt to a constantly changing landscape.  How do you strike a balance between flexibility and consistency?</p>
<p><span id="more-123"></span> <span style="font-weight: bold">Project Specific Framework Selection</span></p>
<p>This is one of the most common approaches and is definitely the most flexible.  Project specific standards basically let the needs of a given project describe the choice of frameworks.  A project needing lots of animation and color manipulation may be built using mootools, a complex RIA may be built using dojo &amp; a simpler project may use prototype or jQuery.  The problem with this approach is the frequent need to learn new API&#8217;s &amp; potential to develop overly superficial knowledge of toolkits that may lead to unnecessarily cumbersome solutions.</p>
<p style="font-weight: bold">Selection of Approved Frameworks</p>
<p>A step beyond project specific framework selection is the adoption of 2 &#8211; 4 approved frameworks within an organization.  In this arrangement, you try to achieve a balance between project appropriateness and standardization.  Usually the frameworks are chosen to accommodate different scales of projects.  A natural breakdown is the use of prototype &amp; scriptaculous where scriptaculous may not be used in every project.  Another breakdown may combine a simple framework like prototype with a RIA platform like Dojo &amp; an intermediate toolkit like jQuery.  In any event, it&#8217;s usually a good idea to pick platforms with similar coding styles &amp; api&#8217;s to maximize the transference of skills between projects.</p>
<p><span style="font-weight: bold">Standardizing on a Single Framework</span></p>
<p>This is definitely a popular approach and prevents any problems with developers needing to relearn things to get up to speed on different projects. Unfortunately, it&#8217;s a very high risk approach as toolkits frequently aren&#8217;t optimal for every project (e.g. dojo for a brochureware site and prototype for a webmail client).  There&#8217;s also the unfortunate possibility of a framework transitioning to an inappropriate licensing model or being abandoned as well.</p>
<p><span style="font-weight: bold">Standardized Coding Practices</span></p>
<p>This is a strategy that can be adopted independent of your framework strategy.  basically, since so many of the various frameworks share constructs and they are all based on javascript.   Adopting a set of coding standards can dramatically simplify collaborative development.  Some of the strategies to consider are:</p>
<ul>
<li>Standardized Naming Conventions (camelcase, underscore etc.)</li>
<li>Standardized File Names</li>
<li>Standardized Function Names</li>
<li>Comment Formating</li>
<li>Chaining limits</li>
</ul>
<p>We&#8217;ll discus coding standards more in the future, but since I&#8217;ve had several recent discussions on adopting a standard for my organization.  I thought I&#8217;d share some of our thoughts with you.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery $ unleash the power of selectors</title>
		<link>http://www.ajaxbestiary.com/2007/10/12/jquery-unleash-the-power-of-selectors/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/12/jquery-unleash-the-power-of-selectors/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 12:05:21 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Article]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/12/jquery-unleash-the-power-of-selectors/</guid>
		<description><![CDATA[

While jQuery is many powerful things, Selectors are quite possibly its most capable and useful feature.  So here&#8217;s the jQuery Selector crash course.
The Ground Rules:

Selectors work just like CSS (1-3) selectors # for ID&#8217;s, . for classes p, div, ul, li etc.
XPath an also be used.
CSS &#38; XPATH selectors can be combined

The $ wrapper.
Selectors [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>While jQuery is many powerful things, Selectors are quite possibly its most capable and useful feature.  So here&#8217;s the jQuery Selector crash course.</p>
<p>The Ground Rules:</p>
<ol>
<li><font color="#333333">Selectors work just like CSS (1-3) selectors # for ID&#8217;s, . for classes p, div, ul, li etc.</font></li>
<li><font color="#333333">XPath an also be used.</font></li>
<li><font color="#333333">CSS &amp; XPATH selectors can be combined</font></li>
</ol>
<p>The $ wrapper.</p>
<p>Selectors + $ = jQuery Nirvana.  The $() function accepts any selector and returns an object that can be manipulated.<br />
<strong>Filters </strong></p>
<p>jQuery filters enhance jQuery Selectors by providing additional logic.  Here&#8217;s a list of supported filters:</p>
<ul>
<li>Not (selector)</li>
<li> first</li>
<li>last</li>
<li>even</li>
<li>odd</li>
<li>eq( index) matches an elements index in returned array</li>
<li>gt( index) matches all elements after given index in an array</li>
<li>lt( index ) matches all elements before given index in an array</li>
<li>header matches all h elements (h1 h2 h3 etc)</li>
<li>animated (matches all elements that are currently being animated)</li>
<li>contains( text) matches all elements which contain given text</li>
<li>empty matches all empty elements</li>
<li>has(selector) matches all elements containing an element that matches the given selector</li>
<li>parent matches all elements that are parents / have child element. (opposite of empty)</li>
<li>hidden matches all elements of type hidden</li>
<li>visible (opposite of hidden)</li>
</ul>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/12/jquery-unleash-the-power-of-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roll Your Own JS Framework: Is It Necessary?</title>
		<link>http://www.ajaxbestiary.com/2007/10/08/roll-your-own-js-framework-is-it-necessary/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/08/roll-your-own-js-framework-is-it-necessary/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 15:47:04 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Toolkit Profile]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/08/roll-your-own-js-framework-is-it-necessary/</guid>
		<description><![CDATA[

Dustin Diaz recently posted about Rolling out your own javascript interface in his blog.
http://www.dustindiaz.com/roll-out-your-own-interface/ 
While his code is nice and clean and it does provide what he was hoping to achieve:
There are times when using a JavaScript library is called for. Building large web applications that use a wide array of utility functions that help aid [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Dustin Diaz recently posted about Rolling out your own javascript interface in his blog.</p>
<p><a href="http://www.dustindiaz.com/roll-out-your-own-interface/">http://www.dustindiaz.com/roll-out-your-own-interface/ </a></p>
<p>While his code is nice and clean and it does provide what he was hoping to achieve:</p>
<blockquote><p>There are times when using a JavaScript library is called for. Building large web applications that use a wide array of utility functions that help aid in developing multi-tiered class systems, advanced UI components, complex event models, and heavy use of DOM scripting helpers. Yep. Those are all great.<br />
However, there are other times when you don’t need all that. And often what we end up doing is just importing a few of our favorite functions as globals, and work off those. But what ends up happening in this case is that we lose the particular style that these libraries offer.</p></blockquote>
<p>In essence, he&#8217;s offering a light weight solution to the fundamental issue persistent to all javascript development: (&#8220;javascript sucks&#8221;). His solution is to coble together a light weight version of prototype containing only what he needs.</p>
<p>My questions are three fold:</p>
<ol>
<li>Is rolling your own framework worth it? The new generation of code profilers for the various toolkits can dramatically decrease download size and focus on the functionality needed.</li>
<li>Is there sufficient demand for a new ultra light weight toolkit to address these issues?</li>
<li>Why not use full toolkits:  Many of them are small enough in compressed form not to make a noticeable difference in load times.</li>
</ol>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/08/roll-your-own-js-framework-is-it-necessary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Menus: The Good, The Bad &amp; The Superfluous</title>
		<link>http://www.ajaxbestiary.com/2007/10/08/javascript-menus-the-good-the-bad-the-superfluous/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/08/javascript-menus-the-good-the-bad-the-superfluous/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 14:32:27 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/08/javascript-menus-the-good-the-bad-the-superfluous/</guid>
		<description><![CDATA[

Menu widgets: Every toolkit&#8217;s got one or more and they sure are easy to use &#38; impressive so the temptation is there to just slap them everywhere.  After all, you&#8217;re already pushing the toolkit to the client anyway, why not make the most of it.
Before you do, tho I encourage you to consider the [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Menu widgets: Every toolkit&#8217;s got one or more and they sure are easy to use &amp; impressive so the temptation is there to just slap them everywhere.  After all, you&#8217;re already pushing the toolkit to the client anyway, why not make the most of it.</p>
<p>Before you do, tho I encourage you to consider the following &amp; ask yourself if the javascript solution is really appropriate.</p>
<p><span id="more-110"></span><strong>The Good: Reasons to use Javascript Menus</strong></p>
<blockquote><p><strong>Event Handling.</strong></p>
<p>The biggest reason to use a frameworks menu system is event handling, plain and simple.  If you have built an ajax ap that utilizes centralized event brokering.  A dynamic menu is all but a necessity for maintainable code &amp; consistent user experience.  That said, if the menu doesn&#8217;t need to be integrated with the scripts on the page (e.g. A site wide navbar), a dynamic menu is likely superfluous.</p>
<p><strong>Branding.</strong></p>
<p>Lets face it, those slick menus with animated effects are damn sexy.  Used effectively, they can really help you capture an audience &amp; encourage a greater depth of exploration by visitors in even the simplest of brochureware sites.  Even better, since the menus can be built from &lt;li&gt; elements they provide excellent accessibility.</p></blockquote>
<p><strong>The Bad: Reasons to Avoid Javascript Menus </strong></p>
<blockquote><p><strong>Reduced Accessibility</strong></p>
<p>JAWS especially doesn&#8217;t deal well with DOM elements created on the client side.  While there are many improvements in accessibility that can come from javascript frameworks (improved tab order, shortcut keys, etc).  Those all require an investment in time and energy at setup.  These allowances, however, do not fully address the issue of users on reduced capability devices or reliably interface with legacy accessibility tools.</p>
<p><strong>Rendering Overhead</strong></p>
<p>Any dynamically generated menu will add to the initial rendering time of the page.  While this may not be an issue on a modern machine running the latest release of an A level browser.  Performance hits can be quite dramatic on a machine loaded down with spyware, vintage hardware or other sub-optimal deployment environments.</p>
<p><strong>Visual Noise.</strong></p>
<p>This goes without saying, KISS is one of the primary rules of interface design.  A big fancy menu will likely call attention to itself at the expense of other content.  After all, what&#8217;s going to bring more value to the site and project a slick menu, or quality, fast loading content.</p>
<p><strong>Page Complexity</strong></p>
<p>KISS applies to markup too.  It&#8217;s a simple fact that the more complex the code, the more opportunities for bugs to slow down the development process.  More significantly, the more complex the code, the longer it takes to grok it again when it comes time to make revisions.</p>
<p>I realize that many of these widgets require little or no markup, so the complexity issue can be a mute point in terms of markup.  The big risk is of course that the code you use will be deprecated or outright removed from the next release of the framework.</p></blockquote>
<p><strong> The Superfluous:</strong></p>
<p>This article was inspired by a recent discussion with a fellow developer.  He spent 2 days struggling  to integrate a pretty slick fish eye menu into the navbar of a website.  While the comp&#8217;s of the bar looked great &amp; everything was functioning well.  The finished site seemed to lack something.  It turns out that so many concessions had been made in the design to accommodate the menu&#8217;s space &amp; bandwidth requirements.  That the entire rest of the project was lackluster for better or worse.   Don&#8217;t let this happen to you.</p>
<p>Remember, menu&#8217;s are not the value added prospect of any site.  They are there to make it easy for our users to find the content &amp; navigate.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/08/javascript-menus-the-good-the-bad-the-superfluous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
