<?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>Ajaxian &#187; Library</title>
	<atom:link href="http://ajaxian.com/by/topic/library/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Tue, 22 May 2012 21:45:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
    	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Adding fibers to your server side v8 diet offers efficiency and clarity</title>
		<link>http://ajaxian.com/archives/adding-fibers-to-your-server-side-v8-diet-offers-efficiency-and-clarity</link>
		<comments>http://ajaxian.com/archives/adding-fibers-to-your-server-side-v8-diet-offers-efficiency-and-clarity#comments</comments>
		<pubDate>Tue, 26 Oct 2010 16:03:32 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=10456</guid>
		<description><![CDATA[In computer science, a fiber is a particularly lightweight thread of execution. Like threads, fibers share address space. However, fibers use co-operative multitasking while threads use pre-emptive multitasking. Threads often depend on the kernel's thread scheduler to preempt a busy thread and resume another thread; fibers yield themselves to run another fiber while executing. The <a href="http://ajaxian.com/archives/adding-fibers-to-your-server-side-v8-diet-offers-efficiency-and-clarity">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>
In computer science, a fiber is a particularly lightweight thread of execution.</p>
<p>Like threads, fibers share address space. However, fibers use co-operative multitasking while threads use pre-emptive multitasking. Threads often depend on the kernel's thread scheduler to preempt a busy thread and resume another thread; fibers yield themselves to run another fiber while executing. The article on threads contains more on the distinction between threads and fibers.</p>
<p>Fibers describe essentially the same concept as coroutines. The distinction, if there is any, is that coroutines are a language-level construct, a form of control flow, while fibers are a systems-level construct, viewed as threads that happen not to run concurrently. Priority is contentious; fibers may be viewed as an implementation of coroutines, or as a substrate on which to implement coroutines.
</p></blockquote>
<p>The above is taken from <a href="http://en.wikipedia.org/wiki/Fiber_(computer_science)">Wikipedia</a>, which is discussing the computer science concepts behind fibers.</p>
<p>Why do we bring this up? The <a href="http://asana.com/">Asana</a> team (who we <a href="http://ajaxian.com/archives/lunascript-a-new-language-and-platform-to-take-your-web-2-0-apps-to-the-moon">featured when they came out with LunaScript</a>) continue their quest to make an ergonomic, productive, and performant framework for the Web.</p>
<p>Today they <a href="http://asana.com/blog/?p=49">are discussing</a> their <a href="http://groups.google.com/group/v8cgi/browse_thread/thread/4c6ed51b4999bdf2">patch to v8cgi</a> that adds in support for their own fiber implementation.</p>
<p>It all ends up with this:</p>
<blockquote><p>
Few languages support fibers natively (though support was recently added to <a href="http://all-thing.net/fibers">Ruby</a>). We write most of our server code in JavaScript and run it under Google’s v8 engine, the same JS runtime that Chrome uses. Fortunately the v8 codebase is excellently structured, so we were able to add fiber support in just a few days. Our changes take the form of a patch (currently pending review) to <a href="http://code.google.com/p/v8cgi/">v8cgi</a>, a library of server-oriented extensions to v8.</p>
<p>Here’s a sample of the API:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-2');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Make a new fiber. The fiber will run the provided function.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> fiber = <span style="color: #003366; font-weight: bold;">new</span> Fiber<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'name'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// Make another fiber runnable.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; some_other_fiber.<span style="color: #006600;">becomeRunnable</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// Suspend the current one.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; Fiber.<span style="color: #006600;">current</span>.<span style="color: #006600;">suspend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Make the new fiber runnable. It won't start until the current fiber suspends</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// or joins.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">fiber.<span style="color: #006600;">becomeRunnable</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Wait for the fiber to finish.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">fiber.<span style="color: #006600;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>That’s almost the entire API. We don’t need any synchronization primitives because only one fiber runs at a time and control only changes when suspend() or join() is called.</p>
<p>There is a tension between writing clear, well-abstracted code and writing code that makes efficient use of the database. Adding fibers to v8 allowed us to resolve this tension.  In taking a small amount of time to solve this problem “right” up front, we’ve made our entire engineering team more efficient for the long run.
</p></blockquote>
<p>Read the post to get the background, and to see the refactoring that is done to get to this place.</p>
<p>Asana seems to be really enjoying rethinking the world of Web frameworks. I can't wait to see their products!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/adding-fibers-to-your-server-side-v8-diet-offers-efficiency-and-clarity/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Yo Yo, develop killer cross platform mobile Web apps with Jo</title>
		<link>http://ajaxian.com/archives/yo-yo-developer-killer-cross-platform-mobile-web-apps-with-jo</link>
		<comments>http://ajaxian.com/archives/yo-yo-developer-killer-cross-platform-mobile-web-apps-with-jo#comments</comments>
		<pubDate>Thu, 07 Oct 2010 06:33:25 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=10415</guid>
		<description><![CDATA[Dave Balmer (formerly YUI, currently working with me on webOS) has created a fantastic cross platform mobile Web framework called Jo. What do I mean by cross platform? webOS, iOS, Android, Symbian, Safari, Chrome, and even Dashboard Widgets. It's philosophy is: If you want to jam an existing web page into an application framework, jo <a href="http://ajaxian.com/archives/yo-yo-developer-killer-cross-platform-mobile-web-apps-with-jo">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://joapp.com/"><img src="http://ajaxian.com/wp-content/images/joapp.png"/></a></p>
<p>Dave Balmer (formerly YUI, currently working with me on webOS) has created a fantastic cross platform mobile Web framework called <a href="http://joapp.com/">Jo</a>. What do I mean by cross platform? webOS, iOS, Android, Symbian, Safari, Chrome, and even Dashboard Widgets. It's philosophy is:</p>
<blockquote><p>
If you want to jam an existing web page into an application framework, jo probably isn't for you. jo is designed to create applications. While it will play nicely with a mixture of new and old web development techniques, it uses HTML5 as a development stack and does not require direct DOM manipulation.
</p></blockquote>
<p>You can setup your views in JavaScript, or also declaratively using special tags:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-4');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-4">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;">&lt;jodialog&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;jofieldset&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;joinput&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/joinput&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;jobutton&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/jobutton&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/jofieldset&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/jodialog&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Take a look at the code and how it plays in action:</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/wOjfKA23Of8?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wOjfKA23Of8?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/yo-yo-developer-killer-cross-platform-mobile-web-apps-with-jo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>innerShiv: Make innerHTML + HTML5 Work in IE</title>
		<link>http://ajaxian.com/archives/innershiv-make-innerhtml-html5-work-in-ie</link>
		<comments>http://ajaxian.com/archives/innershiv-make-innerhtml-html5-work-in-ie#comments</comments>
		<pubDate>Thu, 26 Aug 2010 10:00:47 +0000</pubDate>
		<dc:creator>Brad Neuberg</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9997</guid>
		<description><![CDATA[(Various Shivs) Via JD Bartlett comes HTML5 innerShiv for IE. Before innerShiv, the following would not work in IE: PLAIN TEXT HTML: &#160; var s = document.createElement('div'); s.innerHTML = &#34;&#60;section&#62;Hi!&#60;/section&#62;&#34;; document.body.appendChild(s); &#160; For example, let's imagine we have some CSS that defines the following for the HTML5 elements footer, header, and section: PLAIN TEXT CSS: <a href="http://ajaxian.com/archives/innershiv-make-innerhtml-html5-work-in-ie">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ajaxian.com/wp-content/images/7_knive.jpg"><img class="aligncenter size-full wp-image-9998" title="7_knive" src="http://ajaxian.com/wp-content/images/7_knive.jpg" alt="" width="373" height="247" /></a><em>(Various <a href="http://en.wikipedia.org/wiki/Shiv_(weapon)">Shivs</a>)</em></p>
<p style="text-align: left;">Via <a href="http://jdbartlett.com/">JD Bartlett</a> comes <a href="http://jdbartlett.github.com/innershiv/">HTML5 innerShiv for IE</a>. Before innerShiv, the following would not work in IE:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-9');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-9">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">var s = document.createElement('div');</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">s.innerHTML = &quot;<span style="color: #009900;">&lt;section&gt;</span>Hi!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/section&gt;</span>&quot;;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">document.body.appendChild(s);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>For example, let's imagine we have some CSS that defines the following for the HTML5 elements footer, header, and section:</p>
<div class="igBar"><a href="javascript:showCodeTxt('css-10');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">CSS:</span>
<div id="css-10">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">footer, header, section <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; border<span style="color: #3333ff;">:1px </span>solid #ccc; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000000; font-weight: bold;">display</span>:<span style="color: #993333;">block</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000000; font-weight: bold;">padding</span>:10px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Unfortunately, even if you are using one of the tricks to force IE to deal with HTML5 elements shivs don't work when dealing with innerHTML before an element is appended to the DOM:</p>
<blockquote><p>However, the shiv doesn't work in Internet Explorer when an element's content is added with innerHTML before being appended to the document. That's a common use case, and noticeable in libraries like jQuery when you try to append or load (etc.) HTML5 content</p></blockquote>
<p>Some example bad JQuery code that runs into this problem:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-11');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-11">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#example-1'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">append</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"&lt;section&gt;&lt;header&gt;&lt;h3&gt;Example 1:<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  a broken section&lt;/h3&gt;&lt;/header&gt;&lt;p&gt;This section element should<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  have a black border like the others. It doesn't in Internet<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  Explorer. :(&lt;/p&gt;&lt;/section&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>JD's library is the solution to this problem:</p>
<blockquote><p>innerShiv is a function which takes your HTML string, adds it to a hidden document-appended element in IE, and returns an IE-safe document fragment or collection</p></blockquote>
<p>Now you can do the following to have things work:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-12');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-12">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#example-2'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">append</span><span style="color:#006600; font-weight:bold;">&#40;</span>innerShiv<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"&lt;section&gt;&lt;header&gt;&lt;h3&gt;<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  Example 2: a successfully styled section&lt;/h3&gt;&lt;/header&gt;<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  &lt;p&gt;This section element should have a gray border like the<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  others. And it does! Even in Internet Explorer! Yay!.&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">  &lt;/section&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Note that you don't have to use JQuery to use innerShiv.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/innershiv-make-innerhtml-html5-work-in-ie/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Glimmer: Visual Builder for JQuery Animations</title>
		<link>http://ajaxian.com/archives/glimmer-visual-builder-for-jquery-animations</link>
		<comments>http://ajaxian.com/archives/glimmer-visual-builder-for-jquery-animations#comments</comments>
		<pubDate>Tue, 17 Aug 2010 10:00:19 +0000</pubDate>
		<dc:creator>Brad Neuberg</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9947</guid>
		<description><![CDATA[From Tim Aidlin over at Microsoft comes a tutorial on using JQuery to do animation. The tutorial is focused on using a new library they have designed called Glimmer that allows designers and developers to create interactive elements and animations on web pages using JQuery. Using Glimmer you setup your HTML and CSS and then <a href="http://ajaxian.com/archives/glimmer-visual-builder-for-jquery-animations">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://ajaxian.com/wp-content/images/glimmer2.png"><img src="http://ajaxian.com/wp-content/images/glimmer2.png" alt="" title="glimmer2" width="947" height="375" class="aligncenter size-full wp-image-9949" /></a></p>
<p>From Tim Aidlin over at Microsoft <a href="http://visitmix.com/LabNotes/Using-jQuery-to-animate-a-Hero">comes a tutorial on using JQuery to do animation</a>. The tutorial is focused on using a new library they have designed called <a href="http://visitmix.com/labs/glimmer/">Glimmer</a> that allows designers and developers to create interactive elements and animations on web pages using JQuery. Using Glimmer you setup your HTML and CSS and then use the visual Glimmer tool to create animations and other effects:</p>
<p><a href="http://ajaxian.com/wp-content/images/glimmer1.jpg"><img src="http://ajaxian.com/wp-content/images/glimmer1.jpg" alt="" title="glimmer1" width="327" height="455" class="aligncenter size-full wp-image-9948" /></a></p>
<p>The Glimmer tool then generates JQuery JavaScript automatically that you can pull into your page. An example snippet:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-14');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-14">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">jQuery<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>$<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> timer;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> clear_canvas<span style="color:#006600; font-weight:bold;">&#40;</span>event<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">clearTimeout<span style="color:#006600; font-weight:bold;">&#40;</span>timer<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">timer = setTimeout<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">eval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"big_guy_in"</span><span style="color:#006600; font-weight:bold;">&#41;</span>,<span style="color: #3366CC;">"600"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"#slide1text"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">css</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"left"</span>,<span style="color: #3366CC;">"-800px"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"#slide1text"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">animate</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">"left"</span>:<span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span>,<span style="color:#800000;">600</span>, <span style="color: #3366CC;">"easeOutElastic"</span>, <span style="color: #003366; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span>;$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"#bigGuyPointing"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">css</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"left"</span>,<span style="color: #3366CC;">"600px"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"#bigGuyPointing"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">animate</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">"left"</span>:<span style="color:#800000;">600</span><span style="color:#006600; font-weight:bold;">&#125;</span>,<span style="color:#800000;">1000</span>, <span style="color: #3366CC;">"linear"</span>, <span style="color: #003366; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"#slide1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">css</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"display"</span>,<span style="color: #3366CC;">"block"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"#bigGuyPointing"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">animate</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">"left"</span>:<span style="color:#800000;">600</span><span style="color:#006600; font-weight:bold;">&#125;</span>,<span style="color:#800000;">1000</span>, <span style="color: #3366CC;">"linear"</span>, <span style="color: #003366; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/glimmer-visual-builder-for-jquery-animations/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Canto.js: An Improved Canvas API</title>
		<link>http://ajaxian.com/archives/canto-js-an-improved-canvas-api</link>
		<comments>http://ajaxian.com/archives/canto-js-an-improved-canvas-api#comments</comments>
		<pubDate>Thu, 29 Jul 2010 04:10:24 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9889</guid>
		<description><![CDATA[Javascript author extraordinaire David Flanagan released Canto.js recently, a lightweight wrapper API for canvas, introduced here and documented at the top of the source code. Example: PLAIN TEXT JAVASCRIPT: &#160; canto&#40;"canvas_id"&#41;.moveTo&#40;100,100&#41;.lineTo&#40;200,200,100,200&#41;.closePath&#40;&#41;.stroke&#40;&#41;; &#160; Notice three things: canto() returns an abstraction of the canvas - a "Canto" object. As with jQuery and similar libraries, there's method chaining; <a href="http://ajaxian.com/archives/canto-js-an-improved-canvas-api">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Javascript author extraordinaire David Flanagan released <a href="http://code.google.com/p/canto-js/">Canto.js</a> recently, a lightweight wrapper API for canvas, <a href="http://www.davidflanagan.com/2010/07/cantojs-an-impr.html">introduced here</a> and documented at <a href="http://code.google.com/p/canto-js/source/browse/trunk/canto.js">the top of the source code</a>. Example:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-17');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-17">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">canto<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"canvas_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">moveTo</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">100</span>,<span style="color:#800000;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">lineTo</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">200</span>,<span style="color:#800000;">200</span>,<span style="color:#800000;">100</span>,<span style="color:#800000;">200</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">closePath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">stroke</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Notice three things:</p>
<ul>
<li> canto() returns an abstraction of the canvas - a "Canto" object.
</li>
<li> As with jQuery and similar libraries, there's method chaining; each method called on a Canto also returns the Canto.
</li>
<li> lineTo() has been extended to support multiple lines being drawn in a single call.
</li>
</ul>
<p>Instead of setting the ink properties and then painting it, you can do it all in one step:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-18');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-18">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">canto<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"canvas_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">moveTo</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">100</span>,<span style="color:#800000;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">lineTo</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">200</span>,<span style="color:#800000;">200</span>,<span style="color:#800000;">100</span>,<span style="color:#800000;">200</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">closePath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">stroke</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>lineWidth: <span style="color:#800000;">15</span>, strokeStyle: <span style="color: #3366CC;">"red"</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>And plenty more syntactic sugar - check out the API in the <a href="http://code.google.com/p/canto-js/source/browse/trunk/canto.js">source code comments</a>. Sweet!</p>
<p>Thanks <a href="http://twitter.com/pkeane/statuses/19785917337">@pkeane</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/canto-js-an-improved-canvas-api/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>YUI 3.2.0 preview release 1 &#8211; touch events support, transitions and browser-specific loading</title>
		<link>http://ajaxian.com/archives/yui-3-2-0-preview-release-1-touch-events-support-transitions-and-browser-specific-loading</link>
		<comments>http://ajaxian.com/archives/yui-3-2-0-preview-release-1-touch-events-support-transitions-and-browser-specific-loading#comments</comments>
		<pubDate>Tue, 27 Jul 2010 18:34:02 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[Yahoo!]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9885</guid>
		<description><![CDATA[Over at the the YUI blog the team just announced the preview release of YUI 3.2.0. YUI3 now has some interesting new features that the team wants you to try and tell them if they work out for you. The changes to the already very powerful library are quite ambitious: Touch event support for mobile <a href="http://ajaxian.com/archives/yui-3-2-0-preview-release-1-touch-events-support-transitions-and-browser-specific-loading">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Over at the <a href="http://www.yuiblog.com/blog/2010/07/26/3-2-0pr1/">the YUI blog the team just announced the preview release of YUI 3.2.0</a>. YUI3 now has some interesting new features that the team wants you to try and tell them if they work out for you. The changes to the already very powerful library are quite ambitious:</p>
<ul>
<li><a href="http://yuiblog.com/sandbox/yui/3.2.0pr1/tests/event-gestures/tests/manual/gestures.html">Touch event support</a> for mobile interfaces including flick and move gestures</li>
<li>Browser capability loading - which means that every browser gets the least amount of code necessary to make it work</li>
<li><a href="http://yuiblog.com/sandbox/yui/3.2.0pr1/examples/transition/transition-usage.html">Transition support for the animation module</a> - meaning only browsers that don't support CSS3 transitions get the JavaScript animation fallback</li>
<li>An <a href="http://yuiblog.com/sandbox/yui/3.2.0pr1/examples/cssgrids/cssgrids-units.html">update to the CSS grids</a> to allow for more flexible layouts</li>
<li>A <a href="http://yuiblog.com/sandbox/yui/3.2.0pr1/examples/scrollview/index.html">ScrollView widget</a> similar to the one in Apple iOS</li>
<li>The uploader has been transitioned over from YUI2 to YUI3</li>
</ul>
<p>So check out what is on offer and give the YUI team feedback on what would be nice to have and what is broken. In their own words:</p>
<blockquote><p>The goal of a preview release is to make it as easy as possible for all of us in the community to evaluate progress of the upcoming release and provide feedback.  Please take some time to test 3.2.0pr1 and let us know what you find by filing tickets in the <a href="http://yuilibrary.com/projects/yui3/newticket?version=3.2.0%20PR1">YUI 3 bug database</a> marked as “Observed in version” 3.2.0pr1.  We’ll do our best to address preview-release questions on the <a href="http://yuilibrary.com/forum/viewforum.php?f=15" title="YUI Library :: Forums :: View forum - YUI 3.x:">YUI 3 Forums</a>, too.</p></blockquote>
<p>There are three ways to get started with the preview release:  YUI 3.2.0pr1 is available on the CDN via the 3.2.0pr1 version tag — so you can reference preview-release files like <code><a href="http://yui.yahooapis.com/combo?3.2.0pr1/build/yui/yui-min.js">http://yui.yahooapis.com/combo?3.2.0pr1/build/yui/yui-min.js</a></code>.  If you switch to this seed file for the preview release, all subsequent <code>use()</code> statements will continue to load YUI 3.2.0pr1. Or You can download the full YUI 3.2.0pr1 from <a href="http://yuilibrary.com/downloads/">YUILibrary.com</a>, including source code and examples for all components. Or you can simply explore the <a href="http://yuiblog.com/sandbox/yui/3.2.0pr1/examples/" title="YUI 3: Index of Library Examples">functioning examples roster</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/yui-3-2-0-preview-release-1-touch-events-support-transitions-and-browser-specific-loading/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Inline content assist for text fields and areas</title>
		<link>http://ajaxian.com/archives/inline-content-assist-for-text-fields-and-areas</link>
		<comments>http://ajaxian.com/archives/inline-content-assist-for-text-fields-and-areas#comments</comments>
		<pubDate>Fri, 18 Jun 2010 10:12:04 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9620</guid>
		<description><![CDATA[Sergey Chikuyonok has created a really nice, easy to use, and good looking content assist library for input text fields and text areas: It calculates precise position of characters in &#60;textarea&#62; or &#60;input&#62; tag and places completion proposals popup under it. You can explicitly call popup window to assist/replace word (depends on caret position) with <a href="http://ajaxian.com/archives/inline-content-assist-for-text-fields-and-areas">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Sergey Chikuyonok has created a really nice, easy to use, and good looking <a href="http://media.chikuyonok.ru/content-assist/">content assist library</a> for input text fields and text areas:</p>
<blockquote><p>
It calculates precise position of characters in &lt;textarea&gt; or &lt;input&gt; tag and places completion proposals popup under it. You can explicitly call popup window to assist/replace word (depends on caret position) with Ctrl+Space (buggy in Firefox and Opera) or Alt+Space (buggy in Opera). The project is based on Eclipse IDE's content assist architecture, it has some common class names and methods. The default implementation works with fixed words vocabulary, but developers can easily modify or extend some classes to match their needs.
</p></blockquote>
<p>The API is easy to use. For example:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-20');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-20">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> words = <span style="color: #3366CC;">'after,any,also,around,another,ask,again,air,away,animal,answer,america,awesome,amazing'</span>.<span style="color: #006600;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">','</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">new</span> BasicContentAssist<span style="color:#006600; font-weight:bold;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, words, <span style="color:#006600; font-weight:bold;">&#123;</span>visible_items: <span style="color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><a href="http://media.chikuyonok.ru/content-assist/"><img src="http://ajaxian.com/wp-content/images/contentassist.png" alt="" title="contentassist" width="299" height="146" class="alignnone size-full wp-image-9621" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/inline-content-assist-for-text-fields-and-areas/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sencha Touch: The end of native; A new touch framework for the Web</title>
		<link>http://ajaxian.com/archives/sencha-touch</link>
		<comments>http://ajaxian.com/archives/sencha-touch#comments</comments>
		<pubDate>Thu, 17 Jun 2010 13:00:17 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Sencha]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9613</guid>
		<description><![CDATA[As I walked around Moscone last week, I saw some prophets speaking of a future that isn't all Native. A future where the Web is the platform. Others saw it too: I pondered who would be behind the act and smiled as I had a good idea. The group behind this all is the newly <a href="http://ajaxian.com/archives/sencha-touch">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>As I walked around Moscone last week, I saw some prophets speaking of a future that isn't all Native. A future where the Web is the platform. Others saw it too:</p>
<p><a href="http://techcrunch.com/2010/06/09/robed-prophets-march-in-front-of-apples-wwdc-heralding-the-end-of-native/"><img src="http://ajaxian.com/wp-content/images/endofnative.png" alt="" title="endofnative" width="479" height="269" class="alignnone size-full wp-image-9614" /></a></p>
<p>I pondered who would be behind the <a href="http://twitter.com/endofnative">act</a> and smiled as I had a good idea. The group behind this all is the newly named <a href="http://sencha.com/">Sencha</a> (formerly Ext JS). On the back of news of the new company and Sencha Labs, we get a glimpse of their new product: <a href="http://www.sencha.com/products/touch/">Sencha Touch</a>:</p>
<blockquote><p>
<img src="http://ajaxian.com/wp-content/images/sencha-logo.png" alt="" title="sencha-logo" width="60" height="60" class="alignnone size-full wp-image-9625" style="float:right;padding:8px"/></p>
<p>Sencha Touch allows your web apps to look and feel like native apps. Beautiful user interface components and rich data management, all powered by the latest HTML5 and CSS3 web standards and ready for Android and Apple iOS devices. Keep them web-based or wrap them for distribution on mobile app stores.
</p></blockquote>
<p>There are some good <a href="http://www.sencha.com/products/touch/demos.php">demos of apps</a> such as <a href="http://geocongress.us/">GeoCongress</a>, which shows off:</p>
<p><a href="http://geocongress.us/"><img src="http://ajaxian.com/wp-content/images/geocongress.png" alt="" title="geocongress" width="200" height="257" class="alignnone size-full wp-image-9627" style="float:right;padding:8px"/></a></p>
<ul>
<li>HTML5 Geolocation</li>
<li>Sench Touch icon set</li>
<li>JSONP Proxy</li>
<li>YQL Data Proxy</li>
<li>Momentum scrolling</li>
<li>Scroll touch event</li>
<li>Pop-up Overlays</li>
<li>Mobile form elements</li>
<li>CSS3 Gradients</li>
<li>CSS3 Transitions</li>
<li>Multi-Card Layout</li>
<li>Tab Panel Component</li>
<li>Scrollable list view</li>
<li>Swappable headers</li>
</ul>
<p>Once you see what the framework can do with examples, what better way to get a deeper look than walking though as much of it as possible? Michael Mullany, VP Products, sat down and gave us just that. Sencha Touch comes with a "kitchen sink" demo that shows off much of its abilities. Here we see Michael showing off said demo:</p>
<p><object width="480" height="378"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=12633993&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=12633993&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="378"></embed></object></p>
<p>After seeing this at work, we asked Michael some questions about the new product:</p>
<p><b>How are Ext JS, jQTouch, and Sencha Touch related?</b></p>
<p>We talked about some of this in the Sencha name change post. Jonathan Stark is taking over jQTouch maintainership, Dave Kaneda will remain involved but he's been spending most of his energy on Sencha Touch. Sencha Touch has some Ext JS DNA (OO javascript, a lot of the data package is common), but the UI components are completely different. </p>
<p>Having David part of Sencha Touch has been incredibly important. That's one of the reasons why the UI components are staggeringly beautiful, and there's been so much attention to ease of styling.</p>
<p>With respect to jQTouch vs. Sencha Touch. jQTouch is a good solution for people who need some progressive enhancement of web content, but it's not a full application framework.</p>
<p><b>What is the licensing plan for Sencha Touch?</b></p>
<p>The initial beta is under a GPLv3 + FLOSS license. We’d like to give open source folks the benefit before we introduce a commercial trial license. And we’d like to take the opportunity to emphasize something that many people miss: that we have Free and Open Source exceptions as part of our GPLv3 license. So if you want to, you can include Sencha Touch in your Apache and OSI approved licensed projects without triggering the GPL’ing of your project.</p>
<p><b>Can I make native looking controls for the particular platform at runtime?</b></p>
<p>In the beta, you can build multiple themes easily (for example, our Android theme is 20 lines of customized SASS), and serve them up to different clients based on user agent. We do want to provide a client-side switcher by release time. SASS is really an extraordinary technology. This would be far, far harder without it. </p>
<p><b>Are there any differences between it running on various platforms?</b></p>
<p>There are some minor differences, for example CSS 3D Transitions don't work on Android, for example (no cube transitions). And Apple GPU accelerates more stuff. You can look at our demo apps across iPhone and Android. They really do work cross-platform. </p>
<p><b>How do I do layout with Sencha Touch?</b></p>
<p>We think most people will use fairly simple layouts with the built-in components since the screen sizes are small. Tabs, carousels, lists. If they want to get more complex, they can use the more complex layouts or just extend the built-in classes.</p>
<p><b>Can I create native apps from these? How do I access native services on the device?</b></p>
<p>Right now, you're going to take Sencha and wrap it with phone-gap. But about two third of non-game apps don't do any special device access, and camera access is on its way.</p>
<p><b>How does Sencha Touch feel to program (e.g. just like Ext?)</b></p>
<p>It's still object oriented javascript but it's really very simple. People can just look at the source to the demo apps (which are reasonably rich apps) and make their own decision.</p>
<p><b>Can I progressively enhance a mobile Web app and sprinkle in some of this goodness?</b></p>
<p>I think the success of iPhone native mobile apps shows that for mobile factors, it's better if you think about layout and navigation first, then pour content into your containers &#038; paths. In many ways, I think it's the reverse of the desktop web. Desktop web apps can be random access in their user pathing, mobile apps have to be hierarchical or otherwise constrained -- because you don't have a lot of space and you can't waste it on navigation controls.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/sencha-touch/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Modernizr: Point and see how modern you are</title>
		<link>http://ajaxian.com/archives/modernizr-point-and-see-how-modern-you-are</link>
		<comments>http://ajaxian.com/archives/modernizr-point-and-see-how-modern-you-are#comments</comments>
		<pubDate>Thu, 17 Jun 2010 11:32:15 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9601</guid>
		<description><![CDATA[Modernizr detects feature support across JS APIs and CSS. Now, there is a simple page that shows you what Modernizr thinks of your browser:]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/porschista/2921534869/"><img src="http://ajaxian.com/wp-content/images/2921534869_0a9a72e0df.jpg" alt="" title="modernista" width="500" height="375" class="alignnone size-full wp-image-9602" /></a></p>
<p><a href="http://www.modernizr.com/">Modernizr</a> detects feature support across JS APIs and CSS. Now, there is a simple<br />
<a href="http://modernizr.github.com/Modernizr/output.html">page that shows you</a> what Modernizr thinks of your browser:</p>
<p><iframe src="http://modernizr.github.com/Modernizr/output.html" style="width:460px; height: 300px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/modernizr-point-and-see-how-modern-you-are/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A/B testing your Cohorts with Google Analytics result views</title>
		<link>http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views</link>
		<comments>http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views#comments</comments>
		<pubDate>Tue, 08 Jun 2010 11:37:28 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9519</guid>
		<description><![CDATA[PLAIN TEXT JAVASCRIPT: &#160; var header_test = new Cohorts.Test&#40;&#123; &#160; &#160; name: 'big_vs_small_header', &#160; &#160; sample: 1, // we want to include all visitors in the test &#160; &#160; cohorts: &#123; &#160; &#160; &#160; &#160; big: &#123; &#160; &#160; &#160; &#160; &#160; &#160; onChosen: function&#40;&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $&#40;'#big'&#41;.show&#40;&#41;; <a href="http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<div class="igBar"><a href="javascript:showCodeTxt('javascript-22');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-22">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> header_test = <span style="color: #003366; font-weight: bold;">new</span> Cohorts.<span style="color: #006600;">Test</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">name</span>: <span style="color: #3366CC;">'big_vs_small_header'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; sample: <span style="color:#800000;">1</span>, <span style="color: #009900; font-style: italic;">// we want to include all visitors in the test</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cohorts: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; big: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onChosen: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#big'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; small: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onChosen: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#small'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#big'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">click</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; header_test.<span style="color: #006600;">event</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'Clicked on Header'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#small'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">click</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; header_test.<span style="color: #006600;">event</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'Clicked on Header'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>The code above shows you exactly how you could run a test that shows either a large, or small clickable header... and gives you A/B results on how many were clicked.</p>
<p>This is all view a new library called <a href="http://github.com/jamesyu/cohorts">Cohorts</a> by James Yu:</p>
<blockquote><p>
Cohorts is a simple, purely javascript, multivariate testing framework.</p>
<p>It allows you to easily run split tests for visitors on your site, showing them different designs, layouts, or whatever you want. Cohorts also allows you to track interesting events that occur for each of the cohorts. By default, it uses Google Analytics event tracking to store data, but you can customize it to use your own or another.
</p></blockquote>
<p>Very nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stomple: Stomping to the server via WebSockets</title>
		<link>http://ajaxian.com/archives/stomple-stomping-to-the-server-via-websockets</link>
		<comments>http://ajaxian.com/archives/stomple-stomping-to-the-server-via-websockets#comments</comments>
		<pubDate>Wed, 02 Jun 2010 07:38:47 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9462</guid>
		<description><![CDATA[Karl Krukow has created Stomple, a library that "enables using the browser as a reliable messaging client, e.g. for JMS." It is trivially simple to now have a browser (that supports this new WebSockets world) to join in with JMS backends, and start to consume. To get going it is as simple as: PLAIN TEXT <a href="http://ajaxian.com/archives/stomple-stomping-to-the-server-via-websockets">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Karl Krukow has created <a href="http://blog.higher-order.net/2010/06/01/stomple-rc1-combining-websockets-and-reliable-messaging/">Stomple</a>, a library that "enables using the browser as a reliable messaging client, e.g. for JMS." It is trivially simple to now have a browser (that supports this new WebSockets world) to join in with JMS backends, and start to consume.</p>
<p>To get going it is as simple as:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-24');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-24">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> client = Stomple.<span style="color: #006600;">create_client</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; url : <span style="color: #3366CC;">"ws://localhost:61614/stomp"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; destination : <span style="color: #3366CC;">"jms.topic.chat"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; login : <span style="color: #3366CC;">"guest"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; passcode : <span style="color: #3366CC;">"guest"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">client.<span style="color: #006600;">subscribe</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; success: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>frame<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #009900; font-style: italic;">//called if subscribe succeeds within timeout-period</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//subscribe succeeded... do something</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; failure: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>spec<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #009900; font-style: italic;">//called if subscribe fails or times out</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; console.<span style="color: #006600;">log</span><span style="color:#006600; font-weight:bold;">&#40;</span>spec.<span style="color: #006600;">reason</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; handler: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>msg<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #009900; font-style: italic;">//called when a message arrived ('this' is scope - see below) </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">received</span> = msg.<span style="color: #006600;">body</span>;<span style="color: #009900; font-style: italic;">//&quot;this&quot; is &quot;someObject&quot;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; scope: someObject</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><b>Features</b></p>
<ul>
<li>Customizability and Callbacks. A key value of Stomple is that it shouldn&#8217;t cut off access to any low-level functionality. Hence everything is customizable and accessible to the user code. All core functions support success and failure callbacks. Further, there are low-level callbacks: <tt>socketOpen, socketMessage, socketClose, socketError</tt> corresponding to the low-level websocket events. These can be used to customize behaviour for special use-cases. At a higher-level, there are callbacks <tt>onConnect, connectFailed, onError, onReceipt</tt> correspoding to the Stomp events.</li>
<li>Automatic receipts. If  <tt>client.autoReceipt</tt> is true (which it is by default), then all Stomp messages sent to the server include an automatically generated &#8216;receipt&#8217; header. In the Stomp protocol, this causes the server to send a receipt for each message it receives, hence reassuring that the message has been received. If not enabled, the client can&#8217;t be sure the message is actually received. </li>
<li>Timeouts. By default all messages sent to the server are associated with a (configurable) 8 second timeout. So for example, suppose you subscribe to a destination, but do not receive a server receipt within 8 seconds: then your failure callback is called with reason &#8216;timeout&#8217; and information about the message that failed. This way you are guaranteed that either your success or failure callback will always be called (but not both <img src='http://blog.higher-order.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). These time-outs are pervasive and configurable per API call.</li>
<li>Transaction management. In Stomp, transactions are started using the &#8216;BEGIN&#8217; frame, corresponding to a begin function in Stomple. When you call begin, you don&#8217;t have to specify a transaction-id: if you don&#8217;t, one will be generated automatically for you. Further, any API calls made between a begin and a commit/abort automatically use this transaction identifier, hence grouping the calls in the same transaction (unless, of course, you explicitly provide a different or no transaction id). Further, this nests arbitrarily, and works in a stack-like manner (e.g., begin, begin, send, associates send with inner-most begin). </li>
<li>Feature complete. Stomple aims to be feature complete. For example, it supports the recommended Stomp &#8216;content-length&#8217; header, where the current stomp-websocket version does not.</li>
<li>Correctness. Stomple is tested manually and has a growing automatic test-suite written in YUI3-test. Stomple passes JSLint.</li>
</ul>
<p><a href="http://github.com/krukow/stomple">Fork it</a> and stomp instantly to JMS and beyond.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/stomple-stomping-to-the-server-via-websockets/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two JS solutions to run SQL-like statements on Arrays and Objects</title>
		<link>http://ajaxian.com/archives/two-js-solutions-to-run-sql-like-statements-on-arrays-and-objects</link>
		<comments>http://ajaxian.com/archives/two-js-solutions-to-run-sql-like-statements-on-arrays-and-objects#comments</comments>
		<pubDate>Tue, 01 Jun 2010 09:13:57 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlike]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9430</guid>
		<description><![CDATA[Thomas Frank released SQLike a script that allows you to filter arrays and objects in JavaScript with a SQL-like syntax. Query: PLAIN TEXT JAVASCRIPT: SQLike.q&#40; &#160; &#160; &#123; &#160; &#160; &#160; &#160; Select: &#91;'firstName','&#124;count&#124;','firstName','&#124;sum&#124;','salary','&#124;min&#124;','salary','&#124;max&#124;','salary','&#124;avg&#124;','salary'&#93;, &#160; &#160; &#160; &#160; From: dataArray, &#160; &#160; &#160; &#160; GroupBy: &#91;'firstName'&#93;, &#160; &#160; &#160; &#160; Having: function&#40;&#41;&#123;return this.count_firstName&#62;1&#125;, &#160; &#160; <a href="http://ajaxian.com/archives/two-js-solutions-to-run-sql-like-statements-on-arrays-and-objects">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Thomas Frank released <a href="http://www.thomasfrank.se/sqlike.html">SQLike</a> a script that allows you to filter arrays and objects in JavaScript with a SQL-like syntax. </p>
<p>Query:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-28');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-28">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">SQLike.<span style="color: #006600;">q</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Select: <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'firstName'</span>,<span style="color: #3366CC;">'|count|'</span>,<span style="color: #3366CC;">'firstName'</span>,<span style="color: #3366CC;">'|sum|'</span>,<span style="color: #3366CC;">'salary'</span>,<span style="color: #3366CC;">'|min|'</span>,<span style="color: #3366CC;">'salary'</span>,<span style="color: #3366CC;">'|max|'</span>,<span style="color: #3366CC;">'salary'</span>,<span style="color: #3366CC;">'|avg|'</span>,<span style="color: #3366CC;">'salary'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; From: dataArray,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; GroupBy: <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'firstName'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Having: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">count_firstName</span>&gt;<span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; OrderBy: <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'sum_salary'</span>,<span style="color: #3366CC;">'|desc|'</span><span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Results: </p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-29');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-29">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">"firstName"</span>:<span style="color: #3366CC;">"Stuart"</span>, <span style="color: #3366CC;">"count_firstName"</span>:<span style="color:#800000;">3</span>, <span style="color: #3366CC;">"sum_salary"</span>:<span style="color:#800000;">180000</span>, <span style="color: #3366CC;">"min_salary"</span>:<span style="color:#800000;">41000</span>, <span style="color: #3366CC;">"max_salary"</span>:<span style="color:#800000;">90000</span>, <span style="color: #3366CC;">"avg_salary"</span>:<span style="color:#800000;">60000</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">"firstName"</span>:<span style="color: #3366CC;">"Vicki"</span>, <span style="color: #3366CC;">"count_firstName"</span>:<span style="color:#800000;">2</span>, <span style="color: #3366CC;">"sum_salary"</span>:<span style="color:#800000;">163000</span>, <span style="color: #3366CC;">"min_salary"</span>:<span style="color:#800000;">79000</span>, <span style="color: #3366CC;">"max_salary"</span>:<span style="color:#800000;">84000</span>, <span style="color: #3366CC;">"avg_salary"</span>:<span style="color:#800000;">81500</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>All of this happens in-memory so this is not a contender for <a href="http://developer.yahoo.com/yql">YQL</a> which offers the same functionality as a web service.</p>
<p>Another, very similar solution is <a href="http://jslinq.codeplex.com/">LINQ to JavaScript</a> by Chris Pietschmann:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-30');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-30">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myList = <span style="color:#006600; font-weight:bold;">&#91;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>FirstName:<span style="color: #3366CC;">"Chris"</span>,LastName:<span style="color: #3366CC;">"Pearson"</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>FirstName:<span style="color: #3366CC;">"Kate"</span>,LastName:<span style="color: #3366CC;">"Johnson"</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>FirstName:<span style="color: #3366CC;">"Josh"</span>,LastName:<span style="color: #3366CC;">"Sutherland"</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>FirstName:<span style="color: #3366CC;">"John"</span>,LastName:<span style="color: #3366CC;">"Ronald"</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>FirstName:<span style="color: #3366CC;">"Steve"</span>,LastName:<span style="color: #3366CC;">"Pinkerton"</span><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> exampleArray = JSLINQ<span style="color:#006600; font-weight:bold;">&#40;</span>myList<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.<span style="color: #006600;">Where</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #006600;">FirstName</span> == <span style="color: #3366CC;">"Chris"</span>; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.<span style="color: #006600;">OrderBy</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #006600;">FirstName</span>; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.<span style="color: #006600;">Select</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #006600;">FirstName</span>; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>Personally I like the LINQ syntax better, what do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/two-js-solutions-to-run-sql-like-statements-on-arrays-and-objects/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>towel.js: momentum drag, simple code</title>
		<link>http://ajaxian.com/archives/towel-js-momentum-drag-simple-code</link>
		<comments>http://ajaxian.com/archives/towel-js-momentum-drag-simple-code#comments</comments>
		<pubDate>Thu, 27 May 2010 11:37:08 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9405</guid>
		<description><![CDATA[Scato Eggen, in honor of Towel Day in the Netherlands, has released an open source framework called towel.js. towel.js is an extension for Mootools, designed to make event-based code easier to write and even more important: easier to read. At the hart of towel.js is a modular helper system called towel, including two helpers called <a href="http://ajaxian.com/archives/towel-js-momentum-drag-simple-code">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Towel_Day"><img src="http://upload.wikimedia.org/wikipedia/commons/1/17/Towelday-Innsbruck.jpg" width="480"/></a></p>
<p>Scato Eggen, in honor of <a href="http://en.wikipedia.org/wiki/Towel_Day">Towel Day</a> in the Netherlands, has released an open source framework called <a href="http://www.toweljs.org/">towel.js</a>.</p>
<p>towel.js is an extension for Mootools, designed to make event-based code easier to write and even more important: easier to read.</p>
<p>At the hart of towel.js is a modular helper system called towel, including two helpers called UI and FX. These helpers produce objects that can be linked together: one object detects whether the mouse button is pressed, the other one changes style attributes. By linking these objects together a whole range of effects can be created and added to a page.</p>
<p>To create a simple momentum effect you only have to wire up code such as this:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-32');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-32">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ready<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> dragable = $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'example-skid-dragable'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> down = $towel<span style="color:#006600; font-weight:bold;">&#40;</span>dragable<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">down</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> follow = $towel<span style="color:#006600; font-weight:bold;">&#40;</span>dragable<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">fx</span>.<span style="color: #006600;">follow</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> skid = $towel<span style="color:#006600; font-weight:bold;">&#40;</span>dragable<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">phys</span>.<span style="color: #006600;">skid</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; down.<span style="color: #006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span>follow<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; down.<span style="color: #006600;">not</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span>skid<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/towel-js-momentum-drag-simple-code/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Projekktor: Simply Mighty Video</title>
		<link>http://ajaxian.com/archives/projekktor-simply-mighty-video</link>
		<comments>http://ajaxian.com/archives/projekktor-simply-mighty-video#comments</comments>
		<pubDate>Tue, 18 May 2010 11:36:15 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9306</guid>
		<description><![CDATA[Projekktor is another JavaScript library that sits on top of the &#60;video&#62; tag to provide richer chrome and features, and also backwards compatibility via Flash. Once you load the shim, you can setup config and then you just have to use video: PLAIN TEXT HTML: &#160; &#60;script type="text/javascript"&#62; &#160; &#160; &#160; &#160; // check out <a href="http://ajaxian.com/archives/projekktor-simply-mighty-video">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://projekktor.com/"><img src="http://ajaxian.com/wp-content/images/projekktor.png" alt="" title="projekktor" width="480" height="291" class="alignnone size-full wp-image-9307" /></a></p>
<p><a href="http://projekktor.com/">Projekktor</a> is another JavaScript library that sits on top of the &lt;video&gt; tag to provide richer chrome and features, and also backwards compatibility via Flash. Once you load the shim, you can setup config and then you just have to use video:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-34');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-34">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; // check out all of the config params: http://www.projekktor.com/docs.php#configparams</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var PROJEKKTOR_CONFIG = {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;themesPath:&nbsp;&nbsp;&quot;desired path here&quot;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;playerFlashMP4:&nbsp; &nbsp; &nbsp;&quot;desired path here/playerMP4.swf&quot;,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; };</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;">&lt;video <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"projekktor"</span> poster=<span style="color: #ff0000;">"poster.png"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"this is Projekktor"</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"640"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"385"</span> controls&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;source <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"video.mp4"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"video/mp4"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span> <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- MPEG4 for Safari --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;source <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"video.ogv"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"video/ogg"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span> <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Ogg Theora for Firefox 3.1b2 --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/video&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><b>Features</b></p>
<ul>
<li>Super easy integration to any site: 1) include one JS file 2) use standard video or audio tags 3) done!</li>
<li>Cross browser conformity: What you see is what you get in IE, Opera, Chrome, Safari, Firefox and more.
</li>
<li>Projekktor supports PRE roll and POST roll content for ads and more.
</li>
<li>Server independent random seeking for Theora. No need for expensive RTMP or progressive streaming proxys.
</li>
<li>Projekktor supports playlists.
</li>
<li>Cross browser "no buffer" feature to save bandwidth.
</li>
<li>Optional gui blocking to disable pausing or skipping of trailers and ads.
</li>
<li>Extremely easy theming. All you need to know is how to handle HTML and CSS.
</li>
<li>Unrestricted customization due to an easy to understand JS plugin interface and API.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/projekktor-simply-mighty-video/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RequireJS 0.11 Released; Ready for jQuery</title>
		<link>http://ajaxian.com/archives/requirejs-011</link>
		<comments>http://ajaxian.com/archives/requirejs-011#comments</comments>
		<pubDate>Mon, 17 May 2010 05:11:03 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9311</guid>
		<description><![CDATA[James Burke is moving quickly with his RequireJS library. He recently posted about the requirements that John Resig has for a script loader for jQuery: script loading must be async script loading should do as much in parallel as possible. This means in particular, that it should be possible to avoid dynamic nested dependency loading. <a href="http://ajaxian.com/archives/requirejs-011">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>James Burke is moving quickly with his RequireJS library. He recently posted about the requirements that John Resig has for <a href="http://tagneto.blogspot.com/2010/04/require-for-jquery.html">a script loader for jQuery</a>:</p>
<ol>
<li>script loading must be async
</li>
<li>script loading should do as much in parallel as possible. This means in particular, that it should be possible to avoid dynamic nested dependency loading.
</li>
<li>it looks like a script wrapper is needed to allow #1 and #2 to work effectively, particularly for cross-domain loading. It is unfortunate, but a necessity for script loading in browsers.
</li>
</ol>
<p>With the <a href="http://tagneto.blogspot.com/2010/05/requirejs-0110-released.html">RequireJS 0.11.0 release</a> James feels like he has the features to make that real:</p>
<ul>
<li>There is a new <a href="http://requirejs.org/docs/faq-optimization.html#priority">priority config option</a> to indicate priority, parallel download of build layers.</li>
<li>A new <a href="http://requirejs.org/docs/api.html#jsonp">JSONP plugin</a> allows you to treat any JSONP service as dependency.</li>
<li>require.js should be Caja-compliant. The plugins may not be, but the main require.js file passed cajoling on <a href="http://caja.appspot.com/">http://caja.appspot.com/</a>.</li>
<li>Instructions and optimization support for <a href="http://requirejs.org/docs/faq-advanced.html#rename">renaming require()</a>.</li>
<li>There is a <a href="http://requirejs.org/docs/download.html#requirejstransportD">new RequireJS+Transport D download option</a> that supports the <a href="http://wiki.commonjs.org/wiki/Modules/Transport/D">CommonJS Transport D</a> proposal. This can be useful in conjunction with the server-side <a href="http://github.com/kriszyp/transporter">Transporter project</a>.</li>
</ul>
<p>James mentioned a server side scanning tool.... and Kyle Simpson (of <a href="http://labjs.com/">LABjs</a>) is almost ready to show something there too.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/requirejs-011/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RGraph: Canvas based graphing library</title>
		<link>http://ajaxian.com/archives/rgraph-canvas-based-graphing-library</link>
		<comments>http://ajaxian.com/archives/rgraph-canvas-based-graphing-library#comments</comments>
		<pubDate>Tue, 04 May 2010 05:55:32 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9194</guid>
		<description><![CDATA[There are a few graphing libraries out there. The latest that we have been shown is RGraph by Richard Heyes: RGraph is a graphing/charting software component for websites. It uses HTML5 technologies (the new Canvas tag) which is already present in most modern web browsers to create and show graphs/charts. The graphs are created inside <a href="http://ajaxian.com/archives/rgraph-canvas-based-graphing-library">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>There are a few graphing libraries out there. The latest that we have been shown is <a href="http://www.rgraph.net/">RGraph</a> by Richard Heyes:</p>
<blockquote><p>
<a href="http://www.rgraph.net/">RGraph</a> is a graphing/charting software component for websites. It uses HTML5 technologies (the new Canvas tag) which is already present in most modern web browsers to create and show graphs/charts. The graphs are created inside the web browser, removing the burden from the webserver (just as rendering HTML works) and so it can alleviate some of the burden from a web server.</p>
<p>It supports a wide variety of graph types - from Bar charts, Line charts and Pie charts to Scatter, Rose and Radar charts. In total there's roughly 15 base chart types available with further variations possible too.</p>
<p>It has interactive features (for example zoom, tooltips and annotations) which can improve the usability of a website/web application. It's very easy to work with and extend.
</p></blockquote>
<p><img src="http://ajaxian.com/wp-content/images/rgraph.png" alt="" title="rgraph" width="489" height="231" class="alignnone size-full wp-image-9195"/></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/rgraph-canvas-based-graphing-library/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHPJS: PHP Functions in JS, Now with CommonJS Packaging</title>
		<link>http://ajaxian.com/archives/phpjs</link>
		<comments>http://ajaxian.com/archives/phpjs#comments</comments>
		<pubDate>Thu, 22 Apr 2010 15:11:02 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9120</guid>
		<description><![CDATA[PHPJS is an effort to bring the mammoth PHP API into the land of JS., where it can be used for web apps as well as the increasing number of Javascript applications outside the browser. The homepage explains some of the philosophy behind this project: PHP is a language with many high-level functions and while <a href="http://ajaxian.com/archives/phpjs">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://phpjs.org/"><img src="http://ajaxian.com/wp-content/images/phpjs.png" alt="phpjs" title="phpjs" width="170" height="90" class="alignnone size-full wp-image-9119" /></a></p>
<p><a href="http://phpjs.org/">PHPJS</a> is an effort to bring the mammoth <a href="http://www.php.net/manual/en/funcref.php">PHP API</a> into the land of JS., where it can be used for web apps as well as the increasing number of Javascript applications outside the browser.</p>
<p>The homepage explains some of the philosophy behind this project:</p>
<blockquote>
<p><strong>PHP</strong> is a language with many high-level functions and while they're not always implemented as consistently as we'd like (mostly to blame on its underlying C parts), it has a huge following familiar with its syntax so it makes sense to pick its API as a reference<strong>.</strong> Eliminating the need for our own <a href="http://php.net">documentation</a>, thus making life easier, we hope.  </p>
<p> We recognize <strong>JS</strong> - on the other hand - has beautiful language features, and we encourage you to <a href="http://www.youtube.com/watch?v=hQVTIJBZook">learn them</a>.  Never let php.js be an excuse <u>not to</u>.</p>
<p>For the same reason, we're not porting entire language or control structures of PHP; we stick with the functions.</p>
<p>That said, we think of it as a <strong>challenge</strong> to port everything and decided to also port low-level PHP functions like <a href="http://phpjs.org/functions/strpos:545">strpos</a> even though it may have a JavaScript counterpart (<a href="https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/IndexOf">String.indexOf</a>).  Cause besides the intellectual challenge for us, porting more also opens up php.js to all kinds of thought excercises and study purposes.  And so we leave it up to the developer to <a href="http://phpjs.org/packages/configure">decide what to take from this resource</a>. And what not.</p>
</blockquote>
<p>It's not new - the project's been around a while and went to GitHub last September. However, it's noteworthy as it appears to be fairly unknown in parts of the Javascript community, judging from <a href="http://js.pastebin.com/2RYJWgEX">recent Twitter responsage</a> to a mention of the project. (It was news to me, and I dabble in PHP.)</p>
<p>Moreover, there is significant progress here: project founder Kevin van Zonneveld yesterday <a href="http://twitter.com/kvz/status/12602365534">announced CommonJS support</a>. The homepage indicates it's "first steps", but longer term, this potentially brings a huge corpus of library functions into the realm of CommonJS, a win for reuse and a win for all the PHPers getting into JS.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/phpjs/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Prototype 1.7 RC Sizzles&#8230;</title>
		<link>http://ajaxian.com/archives/prototype-1-7-rc-sizzles</link>
		<comments>http://ajaxian.com/archives/prototype-1-7-rc-sizzles#comments</comments>
		<pubDate>Mon, 05 Apr 2010 18:34:59 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8864</guid>
		<description><![CDATA[Andrew Dupont and the the Prototype team have announced the first RC of Prototype 1.7 which changes the selector engine to Sizzle, a new event API, has new layout/dimensions API, and more. Element#on Element#on is a new way to access the Prototype event API. It provides first-class support for event delegation and simplifies event handler <a href="http://ajaxian.com/archives/prototype-1-7-rc-sizzles">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Andrew Dupont and the the Prototype team have <a href="http://prototypejs.org/2010/4/5/prototype-1-7-rc1-sizzle-layout-dimensions-api-event-delegation-and-more">announced the first RC of Prototype 1.7</a> which changes the selector engine to Sizzle, a new event API, has new layout/dimensions API, and more.</p>
<p><b>Element#on</b></p>
<p><a href="http://api.prototypejs.org/dom/element/on/">Element#on</a> is a new way to access the Prototype event API. It provides first-class support for event delegation and simplifies event handler removal.</p>
<p>E.g.</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-37');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-37">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"messages"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">on</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"click"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>event<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// simple version</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// can also pass in a selector which means</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"messages"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">on</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"click"</span>, <span style="color: #3366CC;">"a.comment_link"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>event, element<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// instead of</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"messages"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">observe</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"click"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>event<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> element = event.<span style="color: #006600;">findElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"a.comment_link"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>element<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><b>Element.Layout</b></p>
<blockquote><p>
The second major feature in 1.7 is Element.Layout, a class for pixel-perfect measurement of element dimensions and offsets.</p>
<p>Now you don't have to decide between properties like offsetWidth (which return numbers, but not the numbers you want) or retrieving computed styles (which have their own set of quirks and require a call to parseInt).</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-38');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-38">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Simple case</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'troz'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">measure</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'width'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 150</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'troz'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">measure</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'border-top'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 5</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Offsets, too:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'troz'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">measure</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 226</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// More complex case</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> layout = $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'troz'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getLayout</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'width'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color: #009900; font-style: italic;">//-&gt; 150</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'height'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 500</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'padding-left'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color: #009900; font-style: italic;">//-&gt; 10</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'margin-left'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">//-&gt; 25</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'border-top'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//-&gt; 5</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'border-bottom'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 5</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'padding-box-width'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 170</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">layout.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'border-box-height'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">//-&gt; 510</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><b>Other fixes</b></p>
<p>The JSON interface slated for ECMAScript 5 is already being implemented in major browsers. It uses many of the same method names as Prototype's existing JSON implementation, but with different behavior, so we rewrote ours to be ES5-compliant and to fall back to the native JSON support where possible. A few other methods, like Object.keys, received similar treatment.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/prototype-1-7-rc-sizzles/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Spritely: sprite and pan away</title>
		<link>http://ajaxian.com/archives/spritely-sprite-and-pan-away</link>
		<comments>http://ajaxian.com/archives/spritely-sprite-and-pan-away#comments</comments>
		<pubDate>Mon, 22 Mar 2010 11:42:45 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8760</guid>
		<description><![CDATA[Spritely is a new jQuery plugin that adds sprite() and pan() to your $(). The fun front page of birds is explained with simple goodness of: PLAIN TEXT JAVASCRIPT: &#160; // animate through 3 frames $&#40;'#bird'&#41;.sprite&#40;&#123;fps: 12, no_of_frames: 3&#125;&#41;; &#160; // clicking on the screen flies a sprite to you $&#40;'#bird'&#41;.sprite&#40;&#123;fps: 12, no_of_frames: 3&#125;&#41;.activeOnClick&#40;&#41;.active&#40;&#41;; $&#40;'body'&#41;.flyToTap&#40;&#41;; <a href="http://ajaxian.com/archives/spritely-sprite-and-pan-away">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://ajaxian.com/wp-content/images/spritely.png" alt="spritely" title="spritely" width="480" height="215" class="alignnone size-full wp-image-8761"/></p>
<p><a href="http://www.spritely.net/">Spritely</a> is a new jQuery plugin that adds <code>sprite()</code> and <code>pan()</code> to your <code>$()</code>.</p>
<p>The fun front page of birds is <a href="http://www.spritely.net/documentation/">explained</a> with simple goodness of:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-40');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-40">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// animate through 3 frames</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#bird'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">sprite</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>fps: <span style="color:#800000;">12</span>, no_of_frames: <span style="color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// clicking on the screen flies a sprite to you</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#bird'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">sprite</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>fps: <span style="color:#800000;">12</span>, no_of_frames: <span style="color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">activeOnClick</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">active</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">flyToTap</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// random movement</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#bird'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; .<span style="color: #006600;">sprite</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>fps: <span style="color:#800000;">8</span>, no_of_frames: <span style="color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; .<span style="color: #006600;">spRandom</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; top: <span style="color:#800000;">70</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left: <span style="color:#800000;">100</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; right: <span style="color:#800000;">200</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bottom: <span style="color:#800000;">340</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; speed: <span style="color:#800000;">4000</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pause: <span style="color:#800000;">3000</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>The library is very new with 0.1 stable and <a href="http://spritely.net/0.2-preview/">0.2 preview</a> out.</p>
<p>Also check out <a href="http://spritely.net/filipealcada/">this demo</a> and <a href="http://twitter.com/_spritely_">follow them</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/spritely-sprite-and-pan-away/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>YQL Geo library &#8211; all your geo needs in pure JavaScript</title>
		<link>http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript</link>
		<comments>http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:04:15 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Geo]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[w3c geo]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8718</guid>
		<description><![CDATA[I just finished doing some talks on geo hacking (slides are available here) and how to use some of the Geo technologies Yahoo and Google provide as part of a University gig in Atlanta. As a lot of the students liked the idea of APIs like GeoPlanet and Placemaker but had a hard time getting <a href="http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>I just finished doing some talks on geo hacking (<a href="http://www.slideshare.net/cheilmann/introduction-to-geo-hacking-with-amongst-others-yahoo-technology-3388374">slides are available here</a>) and how to use some of the Geo technologies Yahoo and Google provide as part of a University gig in Atlanta. </p>
<p>As a lot of the students liked the idea of APIs like <a href="http://developer.yahoo.com/geo">GeoPlanet and Placemaker</a> but had a hard time getting their head around them I thought it a good idea to build a small JavaScript library that does the job for them. </p>
<p>I give you <a href="http://isithackday.com/hacks/geo/yql-geo-library/">the YQL Geo library</a> (<a href="http://github.com/codepo8/YQL-Geo-Library">and its source on GitHub</a>). Using this library you can do the following:</p>
<ul>
<li>Detecting the visitor's location with the W3C geo API and with IP as a fallback</li>
<li>Find geo location from text</li>
<li>Find location from lat/lon pair</li>
<li>Find locations in a certain web document (by URL)</li>
<li>Get the location for a certain IP number</li>
</ul>
<p>And all of that in pure JavaScript. For example:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-45');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-45">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">yqlgeo.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">'paris,fr'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;console.<span style="color: #006600;">log</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Will get you: </p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-46');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-46">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">"place"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"lang"</span>:<span style="color: #3366CC;">"en-US"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"uri"</span>:<span style="color: #3366CC;">"http://where.yahooapis.com/v1/place/615702"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"woeid"</span>:<span style="color: #3366CC;">"615702"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"placeTypeName"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">"7"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Town"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"name"</span>:<span style="color: #3366CC;">"Paris"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"country"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">"FR"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Country"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"France"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"admin1"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">""</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Region"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Ile-de-France"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"admin2"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">"FR-75"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Department"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Paris"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"admin3"</span>:<span style="color: #003366; font-weight: bold;">null</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"locality1"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Town"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Paris"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"locality2"</span>:<span style="color: #003366; font-weight: bold;">null</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"postal"</span>:<span style="color: #003366; font-weight: bold;">null</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"centroid"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"latitude"</span>:<span style="color: #3366CC;">"48.856918"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"longitude"</span>:<span style="color: #3366CC;">"2.341210"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"boundingBox"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"southWest"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"latitude"</span>:<span style="color: #3366CC;">"48.658291"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"longitude"</span>:<span style="color: #3366CC;">"2.086790"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"northEast"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"latitude"</span>:<span style="color: #3366CC;">"49.046940"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"longitude"</span>:<span style="color: #3366CC;">"2.637910"</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Other uses:</p>
<p>This gets the name and the country of a lat/lon pair:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-47');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-47">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">yqlgeo.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">33</span>.<span style="color:#800000;">748</span>,-<span style="color:#800000;">84</span>.<span style="color:#800000;">393</span>,<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">alert</span><span style="color:#006600; font-weight:bold;">&#40;</span>o.<span style="color: #006600;">place</span>.<span style="color: #006600;">name</span> + <span style="color: #3366CC;">','</span> + o.<span style="color: #006600;">place</span>.<span style="color: #006600;">country</span>.<span style="color: #006600;">content</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>This finds the visitor's location (on W3C geo API enabled browsers it asks them to share it - otherwise it detects the IP and locates this one on the planet)</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-48');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-48">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">yqlgeo.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'visitor'</span>,<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">alert</span><span style="color:#006600; font-weight:bold;">&#40;</span>o.<span style="color: #006600;">place</span>.<span style="color: #006600;">name</span> + <span style="color: #3366CC;">','</span> + o.<span style="color: #006600;">place</span>.<span style="color: #006600;">country</span>.<span style="color: #006600;">content</span> +&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">' ('</span> + o.<span style="color: #006600;">place</span>.<span style="color: #006600;">centroid</span>.<span style="color: #006600;">latitude</span> + <span style="color: #3366CC;">','</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;o.<span style="color: #006600;">place</span>.<span style="color: #006600;">centroid</span>.<span style="color: #006600;">longitude</span> + <span style="color: #3366CC;">')'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>Read all about it <a href="http://www.wait-till-i.com/2010/03/11/yql-geo-library-and-introduction-to-geo-hacking-talk/">on my blog</a> and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

