<?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>Mashup Guide &#187; Google AJAX Libraries API</title>
	<atom:link href="http://blog.mashupguide.net/category/google-ajax-libraries-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mashupguide.net</link>
	<description>A blog about Raymond Yee&#039;s Book Pro Web 2.0 Mashups: Remixing Data and Web Services</description>
	<lastBuildDate>Wed, 23 Feb 2011 13:35:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
  <link>http://blog.mashupguide.net</link>
  <url>http://blog.mashupguide.net/favicon.ico</url>
  <title>Mashup Guide</title>
</image>
		<item>
		<title>Learning about JavaScript libraries using the Google Ajax Libraries API</title>
		<link>http://blog.mashupguide.net/2008/11/25/113/</link>
		<comments>http://blog.mashupguide.net/2008/11/25/113/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 17:22:50 +0000</pubDate>
		<dc:creator>raymond.yee</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Chapter 08]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google AJAX Libraries API]]></category>

		<guid isPermaLink="false">http://blog.mashupguide.net/?p=113</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Learning+about+JavaScript+libraries+using+the+Google+Ajax+Libraries+API&amp;rft.aulast=Yee&amp;rft.aufirst=Raymond&amp;rft.subject=AJAX&amp;rft.subject=Chapter+08&amp;rft.subject=Google&amp;rft.subject=Google+AJAX+Libraries+API&amp;rft.source=Mashup+Guide&amp;rft.date=2008-11-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://blog.mashupguide.net/2008/11/25/113/&amp;rft.language=English"></span>
In Chapter 8 of my mashup book, I wrote Ideally there would be one obvious choice for an excellent JavaScript library, and everyone would use it. The current situation is that there are many JavaScript libraries, and it is not at all obvious how they compare. I was hoping that in the course of writing [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Learning+about+JavaScript+libraries+using+the+Google+Ajax+Libraries+API&amp;rft.aulast=Yee&amp;rft.aufirst=Raymond&amp;rft.subject=AJAX&amp;rft.subject=Chapter+08&amp;rft.subject=Google&amp;rft.subject=Google+AJAX+Libraries+API&amp;rft.source=Mashup+Guide&amp;rft.date=2008-11-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://blog.mashupguide.net/2008/11/25/113/&amp;rft.language=English"></span>
<p>In Chapter 8 of my mashup book, I wrote</p>
<ul> Ideally there would be one obvious choice for an  excellent JavaScript library, and everyone would use it. The current  situation is that there are many JavaScript libraries, and it is not at  all obvious how they compare.</ul>
<p>I was hoping that in the course of writing my book, I would have had an  opportunity to do my in-depth study of various JavaScript libraries (of  which there are many, judging from the table in the Wikipedia entry <a class="external" href="http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks">Comparison of JavaScript frameworks</a>).  I raised the question of how to choose a JavaScript library during <a class="external" href="http://blog.mashupguide.net/2008/11/13/preparing-for-a-panel-on-openajax/">a panel on OpenAjax</a> as a way of studying the implications of such initiatives as OpenAjax  -- that is, does OpenAjax make it easier to figure out what JavaScript  library to choose -- or does it allow one to pick and choose the best  parts from a whole range of libraries? These are questions I plan to  raise in my spring 2009 <a class="external" href="http://blog.mixingandremixing.info">Mixing and Remixing Information</a> course.</p>
<p>At any rate, I recently had a chance to take a closer look at <a class="external" href="http://code.google.com/apis/ajaxlibs/">AJAX Libraries API - Google Code</a>,  which is "a content distribution network and loading architecture for  the most popular, open source JavaScript libraries", which at present,  include:</p>
<ul>
<li>jQuery</li>
<li>jQuery UI</li>
<li>Prototype</li>
<li>script.aculo.us</li>
<li>MooTools</li>
<li>Dojo</li>
<li>SWFObject</li>
<li>Yahoo! User Interface Library (YUI)</li>
</ul>
<p>From a pedagogical point of view, the Google AJAX Libraries API, by providing a single common library call (<a class="external" href="http://code.google.com/apis/ajaxlibs/documentation/#googleDotLoad">google.load</a>)  simplifies getting set up with each of the libraries, which otherwise,  would require a different setup. Of course, there are reasons that you  might not want to depend on Google to host JavaScript libraries you use  -- but not having to take care of hosting these files yourself helps  beginners jump right in.</p>
<p>I'm pleased to see that <a class="external" href="http://developer.yahoo.com/yui/">The Yahoo! User Interface Library (YUI)</a> recently became part of the Google API.  I use that library in my course and in my book.  The <a class="external" href="http://googleajaxsearchapi.blogspot.com/2008/11/welcome-yui-scriptaculous-gets-fresh.html">post on Google AJAX Search API Blog announcing this inclusion</a> gave a short code example on how to use YUI with the Google AJAX  Libraries API -- it did not actually show any visible in the user  interface. Here I show to elaborate the example slightly to actually  show something visible in the UI.</p>
<p>To do so, you should take look at the <a class="external" href="http://developer.yahoo.com/yui/calendar/">YUI docs for the calendar widget</a> and understand a bit about what the YUILoader (<a class="external" href="http://developer.yahoo.com/yui/yuiloader/">Yahoo! UI Library: YUI Loader Utility</a> does. One thing to note is that <tt>google.load('yui', '2.6.0');</tt> creates an instance of a global YAHOO object. Secondly, YUILoader takes  care of loading the pieces of YUI required to use the widget that you  want to use -- see <a class="external" href="http://developer.yahoo.com/yui/calendar/#start">Getting Started</a> for more details.  You will also want to load in the default CSS to get started (through the line <tt>&lt;body class="yui-skin-sam"&gt;</tt>).  The modified code I came up with is:</p>
<pre>&lt;head&gt;
  &lt;script src="http://www.google.com/jsapi" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" charset="utf-8"&gt;
  google.load('yui', '2.6.0');
  function init() {
    var loader = new YAHOO.util.YUILoader({
      require: ["button", "calendar"],
      base: "http://ajax.googleapis.com/ajax/libs/yui/2.6.0/build/",
      onSuccess: function() {
        // start playing with buttons and calendars!
        var cal = new YAHOO.widget.Calendar("calContainer");
        cal.render();
      }
    });
    loader.insert();
  }
  google.setOnLoadCallback(init);
  &lt;/script&gt;
&lt;/head&gt;
&lt;body class="yui-skin-sam"&gt;
  &lt;div id="calContainer"&gt;&lt;/div&gt;
&lt;/body&gt;</pre>
<p>which you can run at <a href="http://labs.mashupguide.net/doc/2008/11/google.ajaxlib.yui.eg.html">http://labs.mashupguide.net/doc/2008/11/google.ajaxlib.yui.eg.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mashupguide.net/2008/11/25/113/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

