<?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>MoonKat Creations &#187; jQuery</title>
	<atom:link href="http://www.moonkatcreations.com/category/web-design/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.moonkatcreations.com</link>
	<description>Not just another WordPress blog about web design</description>
	<lastBuildDate>Fri, 10 Sep 2010 20:16:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Finding the Date With jQuery</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 23:03:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=282</guid>
		<description><![CDATA[Based on this post, http://arnelbornales.wordpress.com/2009/02/25/get-the-current-date-using-jquery/, this is a simple script for finding the date]]></description>
			<content:encoded><![CDATA[<p>Based on this post (<a href="http://arnelbornales.wordpress.com/2009/02/25/get-the-current-date-using-jquery/">http://arnelbornales.wordpress.com/2009/02/25/get-the-current-date-using-jquery/</a>) here is a simple script for finding the date:</p>
<p><code><script type="text/javascript">// <![CDATA[
  var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var d = new Date(); var curr_date = d.getDate(); var curr_month = d.getMonth(); var curr_year = d.getFullYear(); document.write(curr_date + "-" + m_names[curr_month] + "-" + curr_year); /* The last two lines above have to placed on a single line */
// ]]&gt;</script></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.event Is Not a Function Error</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 18:31:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Feature]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery tools]]></category>
		<category><![CDATA[scrollable]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=316</guid>
		<description><![CDATA[An out-of-date jQuery file could be causing all kinds of mysterious errors, so make sure you have the latest version ]]></description>
			<content:encoded><![CDATA[<p>Recently, while implementing <a href="http://flowplayer.org/tools/demos/scrollable/index.html">jQuery Tools&#8217;s scrollable</a>, I came across a &#8220;jquery.event is not a function&#8221; error. I used the un-minified versions of the scrollable jQuery along with its plugins, autoscroll and navigator, in order to troubleshoot, but no matter what I tried, I kept getting this same error. Finally I read on a <a href="http://drupal.org/node/638252" target="_blank">drupal forum</a> that this error could be caused by an outdated version of jQuery.js. I updated that file, and the error vanished.</p>
<p>The moral of the story: this out of date file could be causing all kinds of mysterious errors, so make sure you have the latest version of jQuery before spending hours troubleshooting all the other files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy jQuery Form Validation</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 21:40:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=300</guid>
		<description><![CDATA[This is hands-down the easiest jQuery form validation that's out there—that I've found in my hours of searching anyway.]]></description>
			<content:encoded><![CDATA[<p>This is hands-down the easiest jQuery form validation that&#8217;s out there—that I&#8217;ve found anyway.<br />
<code><br />
$('form.validate').submit(function() {<br />
$(this).find('div span').remove();<br />
$(this).find('span.error-message').hide();</code></p>
<p>var valid = true;<br />
$(this).find(&#8216;.req&#8217;).each(function() {<br />
if ($(this).val() == &#8220;&#8221;) {<br />
$(this).after(&#8216;&lt;span&gt;Required!&lt;/span&gt;&#8217;);<br />
valid = false;<br />
} else if ($(this).hasClass(&#8216;req-email&#8217;) &amp;&amp; !checkemail($(this).val())) {<br />
$(this).after(&#8216;&lt;span&gt;Invalid E-mail!&lt;/span&gt;&#8217;);<br />
valid = false;<br />
} else if ($(this).hasClass(&#8216;req-phone&#8217;) &amp;&amp; checkphone($(this).val())) {<br />
$(this).after(&#8216;&lt;span&gt;Numbers Only!&lt;/span&gt;&#8217;);<br />
valid = false;<br />
}<br />
});<br />
if (!valid) {<br />
$(this).find(&#8216;span.error-message&#8217;).text(&#8220;Please correct the above errors.&#8221;).show();<br />
return false;<br />
}<br />
});<br />
function checkemail(e){<br />
var emailfilter = /^w+[+.w-]*@([w-]+.)*w+[w-]*.([a-z]{2,4}|d+)$/i<br />
return emailfilter.test(e);<br />
}<br />
function checkphone(e) {<br />
var filter = /[0-9]/<br />
return filter.test(e);<br />
}</p>
<p>Found here: <a href="http://www.aarongloege.com/blog/web-development/javascript/jquery/easy-form-validation/">http://www.aarongloege.com/blog/web-development/javascript/jquery/easy-form-validation/</a></p>
<p>What makes it even better is that it&#8217;s highly customizable. I used Aaron&#8217;s structure to write my own custom validation. I&#8217;ve shared here the additional/modified filters.</p>
<p><code>function checkemail(e){<br />
var emailfilter = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/<br />
return emailfilter.test(e);<br />
}<br />
function checkphone(e) {<br />
var filter = /[0-9]{10}/<br />
return filter.test(e);<br />
}<br />
function checkzip(e){<br />
var zipfilter = /[0-9]{5}/<br />
return zipfilter.test(e);<br />
}<br />
function checkpassword(e) {<br />
var passwordfilter = /^.{6,50}$/<br />
return passwordfilter.test(e);<br />
}<br />
function checkcreditcard(e) {<br />
var creditcardfilter = /[0-9]{15,16}/<br />
return creditcardfilter.test(e);<br />
}</code></p>
<p>You can write as many of these as you want. Additionally, though he has his error messages writing to a span, you can insert whatever kind of action you want to happen inside the if/else statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forward/Next Script for jQuery Tools Tabs</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 21:07:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=292</guid>
		<description><![CDATA[Make forward and next buttons or links on each tab view. In the rel tags of each button, place the id of the tab that would be next or before in the sequence.]]></description>
			<content:encoded><![CDATA[<p>Make forward and next buttons or links on each tab view. In the rel tags of each button, place the id of the tab that would be next or before in the sequence.</p>
<p><code>&lt;button rel="#tab1"&gt;&amp;nbsp;&lt;/button&gt;<br />
&lt;button rel="#tab3"&gt;&amp;nbsp;&lt;/button&gt;</code></p>
<p>Then, use this handy little script:</p>
<p><code>$('.nav_arrow').click(function () {<br />
var nextPage = $(this).attr('rel');<br />
$(nextPage).click();<br />
return false;<br />
});</code></p>
<p>Effectively, you are telling the forward or next button that if it&#8217;s clicked, cause the corresponding tab to be clicked, opening that view.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Clearfields Plugin</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 20:06:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=286</guid>
		<description><![CDATA[It's easy to implement. Download clearfield.js and link it into your page. Then place the class "clearField" on all your inputs, selects, and textareas. Instantiate the function in your custom javascript page with this:]]></description>
			<content:encoded><![CDATA[<p>This is not the one mentioned on jQuery.com (<a href="http://plugins.jquery.com/project/clearField)">http://plugins.jquery.com/project/clearField)</a>. However, this may have been inspired by it. I can&#8217;t remember where this plugin came from, to be totally honest. It was possibly written by my ex-coworker Nathan. Any-who, if the author steps forward, I will be glad to attribute it.</p>
<p>It&#8217;s easy to implement. Download <a title="Go to clearfield.js" href="http://docs.google.com/leaf?id=0B4rh0uE53CoyYTRlODRhNzEtMjkxMC00NTA1LTlkYzMtNGZhYzA2NDNlZWFm&amp;hl=en&amp;authkey=CKPF1Bg" target="_blank">clearfield.js</a> and link it into your page. Then place the class &#8220;clearField&#8221; on all your inputs, selects, and textareas. Instantiate the function in your custom javascript page with this:</p>
<p><code>$('.clearField').clearField();</code></p>
<p>If you don&#8217;t have access to the form element markup, or you are using a framework, a little bit of jQuery can be used to add the necessary classes:</p>
<p><code>$('input, select').addClass('clearField');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Striping for Table Rows</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/jquery-striping-for-table-rows/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/jquery-striping-for-table-rows/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:05:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=279</guid>
		<description><![CDATA[A simple script to select, and then add striping to table rows: $(&#8216;tr:odd td&#8217;).css(&#8216;background&#8217;,'#yourcolor&#8217;);]]></description>
			<content:encoded><![CDATA[<p>A simple script to select, and then add striping to table rows:</p>
<p>$(&#8216;tr:odd td&#8217;).css(&#8216;background&#8217;,'#yourcolor&#8217;);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/jquery-striping-for-table-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Textarea Maxlength Script</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 18:39:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=268</guid>
		<description><![CDATA[This is a very simple maxlength script, quickly and easily implemented.]]></description>
			<content:encoded><![CDATA[<p>This is a very simple maxlength script, quickly and easily implemented. The original is found at <a title="Link to Dynamic Drive Textarea Maxlength Script" href="http://www.dynamicdrive.com/dynamicindex16/maxlength.htm" target="_blank">http://www.dynamicdrive.com/dynamicindex16/maxlength.htm</a></p>
<p><code><br />
/***********************************************<br />
* Textarea Maxlength script- © Dynamic Drive (www.dynamicdrive.com)<br />
* This notice must stay intact for legal use.<br />
* Visit http://www.dynamicdrive.com/ for full source code<br />
***********************************************/</p>
<p>function ismaxlength(obj){<br />
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""<br />
if (obj.getAttribute &amp;&amp; obj.value.length&gt;mlength)<br />
obj.value=obj.value.substring(0,mlength)<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Option Values from a Select</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/get-option-values-from-a-select/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/get-option-values-from-a-select/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 23:35:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=255</guid>
		<description><![CDATA[This is an easy way to grab all the option values from any regular html select, and print them to your Firebug console as a comma separated list.]]></description>
			<content:encoded><![CDATA[<p>This is an easy way to grab all the option values from any regular html select, and print them to your Firebug console as a comma separated list. (I found this useful when I needed to grab the state names listed on a previous version of a company website.)</p>
<p><code><br />
var newArray = [];<br />
var list = $('#selectID').find('option');<br />
for(var i = 0; i &lt; list.length; i++) {<br />
newArray[i] = list[i].text;<br />
}<br />
console.log(newArray.join(", "));<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/get-option-values-from-a-select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Super Easy jQuery Accordion Menu</title>
		<link>http://www.moonkatcreations.com/web-design/html/super-easy-jquery-accordion-menu/</link>
		<comments>http://www.moonkatcreations.com/web-design/html/super-easy-jquery-accordion-menu/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 22:17:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[accordion menu]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=228</guid>
		<description><![CDATA[I created this accordion menu rather on accident. (See my previous post, ). I was actually writing jQuery to make a show/hide question answer list, and realized it would be really easy to turn it into an accordion menu.

Here's the result:]]></description>
			<content:encoded><![CDATA[<p>I created this accordion menu rather on accident. (See my previous post, ). I was actually writing jQuery to make a show/hide question answer list, and realized it would be really easy to turn it into an accordion menu.</p>
<p>Here&#8217;s the result:</p>
<ul id="accordian_menu">
<li><a class="toggleLink" href="#">Our Company</a>
<ul class="hidden">
<li><a href="#">About Us</a></li>
<li><a href="#">History</a></li>
</ul>
</li>
<li><a class="toggleLink" href="#">Products/Services</a>
<ul class="hidden">
<li><a href="#">Custom Web Design</a></li>
<li><a href="#">Content Management Solutions</a></li>
<li><a href="#">Website Optimization</a></li>
<li><a href="#">Email Campaigns</a></li>
</ul>
</li>
<li><a class="toggleLink" href="#">Portfolio</a>
<ul class="hidden">
<li><a href="#">Static HTML</a></li>
<li><a href="#">WordPress Themes</a></li>
<li><a href="#">Emails</a></li>
</ul>
</li>
<li><a class="toggleLink" href="#">Contact</a>
<ul class="hidden">
<li><a href="#">Phone</a></li>
<li><a href="#">Email</a></li>
<li><a href="#">Request a Quote</a></li>
</ul>
</li>
</ul>
<p>How to create it:</p>
<p>1. Include the jQuery library in your page with a script tag. Example:</p>
<pre>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;</pre>
<p>This example links directly to the jQuery library hosted on google. You may link to your own copy.</p>
<p>2. Create a new .js document, and add this code:</p>
<pre>$(document).ready(function(){
	$("ul.hidden").hide();
	$("a.toggleLink").click(function () {
		$("ul.hidden").not($(this).next("ul:first")).slideUp();
		$(this).next("ul:first").slideToggle("normal");
	});
});</pre>
<p>Add this file using the &lt;script&gt; tag.</p>
<p>3. Add this to the body of your page:</p>
<pre>&lt;ul id="accordian_menu"&gt;

     &lt;li&gt;&lt;a href="#" class="toggleLink"&gt;Our Company&lt;/a&gt;

     &lt;ul class="hidden"&gt;

     &lt;li&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;History&lt;/a&gt;&lt;/li&gt;

     &lt;/ul&gt;

     &lt;/li&gt;

     &lt;li&gt;&lt;a href="#" class="toggleLink"&gt;Products/Services&lt;/a&gt;

     &lt;ul class="hidden"&gt;

     &lt;li&gt;&lt;a href="#"&gt;Custom Web Design&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Content Management Solutions&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Website Optimization&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Email Campaigns&lt;/a&gt;&lt;/li&gt;

     &lt;/ul&gt;

     &lt;/li&gt;

     &lt;li&gt;&lt;a href="#" class="toggleLink"&gt;Portfolio&lt;/a&gt;

     &lt;ul class="hidden"&gt;

     &lt;li&gt;&lt;a href="#"&gt;Static HTML&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Wordpress Themes&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Emails&lt;/a&gt;&lt;/li&gt;

     &lt;/ul&gt;

     &lt;/li&gt;

     &lt;li&gt;&lt;a href="#" class="toggleLink"&gt;Contact&lt;/a&gt;

     &lt;ul class="hidden"&gt;

     &lt;li&gt;&lt;a href="#"&gt;Phone&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Email&lt;/a&gt;&lt;/li&gt;

     &lt;li&gt;&lt;a href="#"&gt;Request a Quote&lt;/a&gt;&lt;/li&gt;

     &lt;/ul&gt;

     &lt;/li&gt;

&lt;/ul&gt;</pre>
<p>4. Add these classes to your stylesheet:</p>
<pre>a {
	text-decoration: none;
}
a.toggleLink {
	display: block;
	padding: 5px;
	background: #936;
	color: white;
	border-bottom:1px dotted #CC99CC;
	}
ul#accordian_menu {
	margin: 0;
	padding: 0;
	width: 150px;
}
ul#accordian_menu li {
	list-style-type: none;
}
ul#accordian_menu li ul {
	padding-left: 0;
	background: #FFDAEE;
}
ul#accordian_menu li ul li {
}
ul#accordian_menu li ul li a:hover {
	background: white;
}
ul#accordian_menu li ul li a {
	color: #936;
	display: block;
	border-bottom: 1px dotted #C9C;
	padding: 5px;
}</pre>
<p>These classes could probably be refined a little, but I kept them pretty specific so they won&#8217;t conflict with any similar markup that might be in your page. Feel free to rename or change them to suit your needs.</p>
<p><strong>Take it further:</strong></p>
<ul>
<li>Use divs or paragraphs instead of list items to make a show/hide section of content.</li>
<li>If static (non-sliding content) will be wedged anywhere between your sliding elements, you must use the .nextAll() method, instead of .next().</li>
</ul>
<p>Note: If you&#8217;re new to jQuery, you only need to include the $(document).ready(function()) once in your javascript document&#8211;wrap it around all of your functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/html/super-easy-jquery-accordion-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding jQuery to WordPress</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/adding-jquery-to-wordpress/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/adding-jquery-to-wordpress/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 00:11:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=217</guid>
		<description><![CDATA[You could add your custom jQuery to Wordpress by using the script tag in your head template, but this method can cause conflicts with JavaScript in other Wordpress plugins.

Instead, use the wp_enqueue_script, the Wordpress-friendly method. You will need direct access to your Wordpress files.]]></description>
			<content:encoded><![CDATA[<p>You <em>could</em> add your custom jQuery to WordPress by using the script tag in your head template, but this method can cause conflicts with JavaScript in other WordPress plugins.</p>
<p>Instead, use the wp_enqueue_script, the WordPress-friendly method. You will need direct access to your WordPress files.</p>
<ol>
<li>Go into wp-content/plugins, and create a new javascript folder.</li>
<li>In this folder, place your .js file.</li>
<li>In header.php, before &lt;?php wp_head(); ?&gt;, place this:</li>
</ol>
<pre>&lt;?php
wp_enqueue_script('custom',
'/' . PLUGINDIR . '/javascript/yourscript.js',
array('jquery'),
'1.0' );
?&gt;</pre>
<p>That&#8217;s it. You don&#8217;t need to do anything additional to include the jQuery library, since it&#8217;s specified as in the array as a file that your script is dependent upon. In place of &#8216;jquery&#8217; you can use Scriptaculous, jQuery UI Tabs, or any number of libraries that are built into WordPress.</p>
<p>Those libraries, as well as additional information about the wp_enqueue_script can be found at <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">codex.wordpress.org/Function_Reference/wp_enqueue_script</a>.</p>
<p>According to the codex, this script can&#8217;t be placed above &lt;?php wp_head(); ?&gt;, but I&#8217;ve found that on the contrary, it works ONLY when placed above it. This same page of the codex also says that &#8216;$&#8217; can be used instead of &#8216;jQuery&#8217; inside the document ready function, which is also currently not accurate.</p>
<p>In other words, where you would use &#8216;$&#8217; in your jQuery function, you MUST use &#8216;jQuery&#8217; for every instance, not just in the document ready function. Feel free to test this with your own script; I&#8217;m not sure why the Codex is wrong on these points.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/adding-jquery-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
