<?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>Themocracy WordPress Themes &#187; mootools</title>
	<atom:link href="http://themocracy.com/tag/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://themocracy.com</link>
	<description>WordPress Theme Design</description>
	<lastBuildDate>Mon, 26 Jul 2010 06:18:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Google Code libraries with WordPress</title>
		<link>http://themocracy.com/2010/02/using-google-code-libraries-with-wordpress/</link>
		<comments>http://themocracy.com/2010/02/using-google-code-libraries-with-wordpress/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 15:54:40 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=224</guid>
		<description><![CDATA[By default, WordPress loads the version of jQuery that comes with the package. But there is an alternative way of doing it and that&#8217;s to use the AJAX Libraries API at Google Code &#8211; use their bandwidth, why not&#8230;
A few lines added to your functions.php in the theme you&#8217;re building and you&#8217;re ready to go.

 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F02%2Fusing-google-code-libraries-with-wordpress%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F02%2Fusing-google-code-libraries-with-wordpress%2F" height="61" width="51" /></a></div><p><img class="alignright size-full wp-image-207" title="wordpress-250x250" src="http://themocracy.com/wp-content/uploads/2010/01/wordpress-250x250.png" alt="" width="192" height="192" /><strong>By default, WordPress loads the version of jQuery that comes with the package.</strong> But there is an alternative way of doing it and that&#8217;s to use the AJAX Libraries API at Google Code &#8211; use their bandwidth, why not&#8230;</p>
<p>A few lines added to your functions.php in the theme you&#8217;re building and you&#8217;re ready to go.<br />
<span id="more-224"></span><br />
<strong> wp_register_script()</strong> &#8211; the useful point is that you can use this function to access scripts hosted elsewhere&#8230;</p>
<p>Just add this code to your <strong>functions.php</strong> file:</p>
<pre class="brush: php">
add_action(&#039;template_redirect&#039;, &#039;js_head_load&#039;);

function js_head_load(){

if(is_admin()) return;

wp_deregister_script(&#039;jquery&#039;);
wp_register_script(&#039;jquery&#039;, &#039;http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js&#039;);
wp_enqueue_script(&#039;jquery&#039;);
// and then any other scripts to register and queue...
}
</pre>
<p>Notice the first line of the function ensures that the jQuery isn&#8217;t loaded on WP admin pages -<em> if a script isn&#8217;t needed, don&#8217;t load it on the page</em> &#8211; and in this case jQuery in noConflict mode  can cause the admin rich text editor and the widget drag and drop interface to go awry..</p>
<p><strong>The advantages</strong>:-<br />
You&#8217;ll be able to update the version your site is using quickly and easily, probably a good thing.</p>
<p>Google Code tends to have a policy of only including versions demonstrated to be stable, jQuery 1.2.4 and 1.2.5 didn&#8217;t make the grade</p>
<p>The user may already have it cached in their browser via some previously visited site instead of downloading from a location on your site (and if enough sites do it, the chances are that much greater that they will have a copy in the cache).</p>
<p>Not just jQuery &#8211; check out jQuery UI<br />
<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js">http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js</a><br />
And MooTools, which seems seriously under-used in conjunction with WordPress<br />
<a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js">http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js</a></p>
<p>Always grab the minified version.</p>
<p>And lastly, one disadvantage:- googleapis.com does go down very occasionally &#8211; but then again a site ought to function, more or less, without javaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/02/using-google-code-libraries-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
