<?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>Eric Martin &#187; jQuery</title>
	<atom:link href="http://www.ericmmartin.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ericmmartin.com</link>
	<description></description>
	<lastBuildDate>Tue, 23 Aug 2011 13:36:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>SimpleModal Login 1.0 Released</title>
		<link>http://www.ericmmartin.com/simplemodal-login-1-0-released/</link>
		<comments>http://www.ericmmartin.com/simplemodal-login-1-0-released/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 18:30:19 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SimpleModal]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=1008</guid>
		<description><![CDATA[I'm happy to (finally) announce the release of SimpleModal Login 1.0! I've been working off-and-on since the beginning of the 2010 on adding new features, such as user registration, password reset and an activity indicator. All of those features are included in 1.0 as well as the following: Added support for Peter's Login Redirect plugin [...]]]></description>
			<content:encoded><![CDATA[<p>I'm happy to (finally) announce the release of SimpleModal Login 1.0!</p>
<p><img src="http://www.ericmmartin.com/wordpress/wp-content/uploads/2010/09/screenshot-1-300x240.png" alt="" title="SimpleModal Login Default" width="150" height="120" /> <img src="http://www.ericmmartin.com/wordpress/wp-content/uploads/2010/09/screenshot-5-300x224.png" alt="" title="SimpleModal Login OSX" width="160" height="120" /></p>
<p>I've been working off-and-on since the beginning of the 2010 on adding new features, such as user registration, password reset and an activity indicator. All of those features are included in 1.0 as well as the following:</p>
<p><span id="more-1008"></span></p>
<ul>
<li>Added support for <a href="http://wordpress.org/extend/plugins/peters-login-redirect/">Peter's Login Redirect</a> plugin</li>
<li>Added additional error handling</li>
<li>Added Keyboard Shortcut option and feature (<code>Ctrl+Alt+L</code>)</li>
<li>Removed the 'Redirect after login?' option</li>
<li>Updated POT file (I18n/simplemodal-login.pot)</li>
<li>Added plugin update logic</li>
<li>Upgraded to <a href="http://www.ericmmartin.com/projects/simplemodal/">SimpleModal</a> 1.4</li>
<li>Added additional screenshots</li>
<li>Added filters for each form (login, register, password reset) output HTML to allow for customization</li>
</ul>
<p>If you have any feedback, feel free to leave a comment here. If you have a question or issue, please post it in the <a href='http://wordpress.org/tags/simplemodal-login#postform'>WordPress support forum</a>.</p>
<h3>Links:</h3>
<ul>
<li><a href='http://www.ericmmartin.com/projects/simplemodal-login/'>Project Page</a></li>
<li><a href='http://wordpress.org/extend/plugins/simplemodal-login/'>WordPress Page</a> (Download, FAQ and Installation details)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/simplemodal-login-1-0-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery Enlightenment Review &amp; Giveaway</title>
		<link>http://www.ericmmartin.com/jquery-enlightenment-review-giveaway/</link>
		<comments>http://www.ericmmartin.com/jquery-enlightenment-review-giveaway/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 17:19:21 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=944</guid>
		<description><![CDATA[After buying and reading Cody Lindley's jQuery Enlightenment last year, I was so impressed with it that I asked Cody if he'd be willing to provide me with some discount codes to share on my blog. Expecting 25% off coupons or something similar, I was very surprised when he generously gave me 3 coupons for [...]]]></description>
			<content:encoded><![CDATA[<p>After buying and reading <a href="http://www.codylindley.com/">Cody Lindley's</a> <a href="http://www.jqueryenlightenment.com/">jQuery Enlightenment</a> last year, I was so impressed with it that I asked Cody if he'd be willing to provide me with some discount codes to share on my blog. Expecting 25% off coupons or something similar, I was very surprised when he generously gave me 3 coupons for <strong>free</strong> copies of his popular book.</p>
<h4>My Review</h4>
<p>I don't usually buy technical books; I'm more of a hands-on learner and the books that I've purchased in the past just collect dust. It's one of the reasons why I'm so impressed with jQuery Enlightenment. Besides being an eBook (and therefore can't collect dust), Cody has structured the book in a way that makes it perfect to have as a learning tool as well as a reference.</p>
<p><span id="more-944"></span><br />
You can read the book top-down or skim through the topics, find something you're interested in, and get a detailed and easy to understand write-up on the subject. Cody takes the learning processes one step further by providing code examples, linked to <a href="http://jsbin.com">JS BIN</a>, that can be viewed and run in your browser. For someone like me, the concrete examples and ability to play with the concepts, helps reinforce the topics covered.</p>
<p>Whether you are a new jQuery users, or a seasoned jQuery developer, jQuery Enlightenment won't disappoint!</p>
<h4>jQuery 1.4</h4>
<p>The current version of jQuery Enlightenment was written for jQuery 1.3.2. I spoke to Cody about the recent release of jQuery 1.4 and his plans for an update. He is working on a new version of the book that he estimates will have twice the content (or more) and is tentatively priced at $30. Lastly, he plans to offer a limited-time discount on the update for existing jQuery Enlightenment owners. [Note from Cody: All of this information is subject to change]</p>
<h4>Giveaway</h4>
<p>As mentioned previously, I have 3 coupons available for free copies of jQuery Enlightenment. If you would like a chance to win, leave a comment below and on Wednesday (1/20) at 2pm PST, I will randomly select 3 people.</p>
<h4>Winners!</h4>
<p>The random number generator has spoken and the following people have won a coupon for a free copy of jQuery Enlightenment:</p>
<ul>
<li>Jim</li>
<li>Sam De La Garza</li>
<li>Bjorn van der Neut</li>
</ul>
<p>I'll be sending the coupons codes out shortly. Congratulations, I know you'll enjoy the book.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/jquery-enlightenment-review-giveaway/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>SimpleModal Login Released</title>
		<link>http://www.ericmmartin.com/simplemodal-login-released/</link>
		<comments>http://www.ericmmartin.com/simplemodal-login-released/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 14:58:21 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SimpleModal]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=925</guid>
		<description><![CDATA[I'd like to introduce SimpleModal Login, a modal Ajax login for WordPress which utilizes jQuery and the SimpleModal jQuery plugin. SimpleModal Login handles logging into WordPress but does not handle user registration or the forgot password functions. SimpleModal Login also supports themes, something I'm planning on adding to the SimpleModal Contact Form plugin as well. [...]]]></description>
			<content:encoded><![CDATA[<p>I'd like to introduce <a href="http://www.ericmmartin.com/projects/simplemodal-login/">SimpleModal Login</a>, a modal Ajax login for WordPress which utilizes jQuery and the SimpleModal jQuery plugin.</p>
<p>SimpleModal Login handles logging into WordPress but does not handle user registration or the forgot password functions.</p>
<p>SimpleModal Login also supports themes, something I'm planning on adding to the <a href="http://www.ericmmartin.com/projects/smcf/">SimpleModal Contact Form</a> plugin as well.</p>
<p>If you have any feedback or issues, please let me know!</p>
<p><a href="http://wordpress.org/extend/plugins/simplemodal-login/" class="button">Download</a> <a href="http://www.ericmmartin.com/projects/simplemodal-login/" class="button">Project Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/simplemodal-login-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>5 Tips For Using jQuery with WordPress</title>
		<link>http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/</link>
		<comments>http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:59:50 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=832</guid>
		<description><![CDATA[Having used jQuery and WordPress together on a number of plugins and themes, I thought I'd share some tips that I have learned. The following are 5 clear, concise, and relevant tips that you should know when using jQuery in your WordPress Theme or Plugin. 1. Use wp_enqueue_script() The traditional way to include jQuery in [...]]]></description>
			<content:encoded><![CDATA[<p>Having used jQuery and WordPress together on a number of plugins and themes, I thought I'd share some tips that I have learned. The following are 5 clear, concise, and relevant tips that you should know when using jQuery in your WordPress Theme or Plugin.</p>
<h4>1. Use wp_enqueue_script()</h4>
<p>The traditional way to include jQuery in an HTML page is with the <code>script</code> tag. When working with WordPress, you should *never* do this. To avoid conflicts and other potential problems, you'll want to load jQuery using the following code:</p>
<p><span id="more-832"></span></p>
<pre><code>function my_init() {
	if (!is_admin()) {
		wp_enqueue_script('jquery');
	}
}
add_action('init', 'my_init');
</code></pre>
<p>You can replace <code>my_init</code> with something more meaningful, but choose a unique name to avoid conflicts. For plugin development, add the code in your plugin file, otherwise, add this code to your theme's <code>functions.php</code> file. The <code>is_admin()</code> check is to prevent script queuing on your admin pages.</p>
<p>WordPress References:</p>
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">wp_enqueue_script()</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/add_action">add_action()</a></li>
<li><a href="http://codex.wordpress.org/Conditional_Tags#The_Administration_Panels">is_admin()</a></li>
</ul>
<h4>2. Load jQuery from the Google AJAX Library</h4>
<p>Since WordPress includes jQuery, calling <code>wp_enqueue_script('jquery');</code> will automatically load the jQuery file located in <code>wp-includes/js/jquery/jquery.js</code>. </p>
<p>If you want to load jQuery from the <a href="http://code.google.com/apis/ajaxlibs/">Google AJAX Library</a>, you'll need to modify the code as follows:</p>
<pre><code>function my_init() {
	if (!is_admin()) {
		// comment out the next two lines to load the local copy of jQuery
		wp_deregister_script('jquery');
		wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.3.2');
		wp_enqueue_script('jquery');
	}
}
add_action('init', 'my_init');
</code></pre>
<p>There are a <a href="http://www.google.com/search?q=google+jquery">number of reasons</a> why you would want to use the Google AJAX Library to load jQuery, but remember, Google has been down before, so be ready to comment out the first two lines if necessary.</p>
<p>Note: As mentioned by Milan in the comments, there are existing plugins, such as <a href="http://wordpress.org/extend/plugins/use-google-libraries/">Use Google Libraries</a>, that will do this for you.</p>
<h4>3. Load jQuery in the footer</h4>
<p>Using the code in the previous two tips, jQuery will, by default, be inserted into the <code>head</code> of your HTML page. If you would prefer to have jQuery inserted at the bottom of your page, you'll need to use the <code>$in_footer</code> parameter for the <code>wp_enqueue_script()</code> function. The modified code:</p>
<pre><code>function my_init() {
	if (!is_admin()) {
		wp_deregister_script('jquery');

		// load the local copy of jQuery in the footer
		wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', false, '1.3.2', true);

		// or load the Google API copy in the footer
		//wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.3.2', true);

		wp_enqueue_script('jquery');
	}
}
add_action('init', 'my_init');
</code></pre>
<p>As with the choice to use the Google AJAX Library, there are <a href="http://developer.yahoo.com/performance/rules.html#js_bottom">reasons</a> why you'd want to load jQuery at the bottom of your page. Note: if a script is loaded using <code>wp_enqeue_script()</code> that lists jQuery as a dependency and has <code>$in_footer</code> set to <code>false</code>, WordPress will place jQuery in the <code>head</code> instead of the footer, regardless of the <code>$in_footer</code> value for jQuery.</p>
<h4>4. Add jQuery as a dependency</h4>
<p>You've got jQuery loading and now you want to include a script that uses it. This is where the <code>wp_enqueue_script()</code> function really comes in handy. By passing an array of dependencies for the <code>$deps</code> parameter, WordPress will automatically manage the order and placement of your <code>script</code> tags.</p>
<p>For example, if you have a JavaScript file in your theme that leveraged jQuery, the following code would ensure that your file is loaded correctly:</p>
<pre><code>function my_init() {
	if (!is_admin()) {
		wp_deregister_script('jquery');
		wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.3.2', true);
		wp_enqueue_script('jquery');

		// load a JS file from my theme: js/theme.js
		wp_enqueue_script('my_script', get_bloginfo('template_url') . '/js/theme.js', array('jquery'), '1.0', true);
	}
}
add_action('init', 'my_init');
</code></pre>
<p>The previous code example would load jQuery from the Google AJAX Library, place it in the footer of your page and then include your theme.js file. The <code>$deps</code> array allows for multiple dependencies and helps you manage the scripts that are loaded on your site.</p>
<h4>5. Proper jQuery coding conventions</h4>
<p>All of the previous steps are nullified if proper jQuery coding conventions aren't followed. The most common issue I see with jQuery and WordPress is the misuse of the <code>$</code> variable.</p>
<p>It is important to know that the version of jQuery that comes with WordPress automatically calls the <code>jQuery.noConflict();</code> function, which gives control of the <code>$</code> variable back to whichever library first implemented it. If you are loading a different copy of jQuery, you'll need to manually call <code>jQuery.noConflict();</code>, if necessary, from one of your JavaScript files.</p>
<p>As a general rule, you should not use the <code>$</code> variable for jQuery unless you have used one of the <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries#Referencing_Magic_-_Shortcuts_for_jQuery">shortcuts</a>. The following is an example of how to shortcut jQuery to safely use the <code>$</code> variable:</p>
<pre><code>jQuery(function ($) {
	/* You can safely use $ in this code block to reference jQuery */
});
</code></pre>
<div class="summary">
<p>This is the second article in a series of tips and tricks for customizing and improving your WordPress site. Be sure to <a href="http://feeds.ericmmartin.com/emm/">subscribe</a> or bookmark this site.</p>
<p>If you have any other related WordPress tips, feel free to leave them in the comments below.
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>New Version of EricMMartin.com</title>
		<link>http://www.ericmmartin.com/new-version-of-ericmmartin-com/</link>
		<comments>http://www.ericmmartin.com/new-version-of-ericmmartin-com/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 19:32:10 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=709</guid>
		<description><![CDATA[After months of design changes and WordPress theme customizations, I'm happy to introduce the latest version of EricMMartin.com! I've actually been working on this redesign, on again, off again, for the last year or so. Although the design has been through a number of changes, the technologies I wanted to build the site with have [...]]]></description>
			<content:encoded><![CDATA[<p>After months of design changes and WordPress theme customizations, I'm happy to introduce the latest version of <a href="http://www.ericmmartin.com">EricMMartin.com</a>!</p>
<p>I've actually been working on this redesign, on again, off again, for the last year or so. Although the design has been through a number of changes, the technologies I wanted to build the site with have remained the same: <a href="http://wordpress.org">WordPress</a> and <a href="http://jquery.com">jQuery</a>.</p>
<p>So, I'd love to hear your thoughts on the new design - please leave a comment. If you didn't see the previous version, here's a screenshot of what it looked like:</p>
<p><span id="more-709"></span><br />
<a href="http://www.ericmmartin.com/wordpress/wp-content/uploads/2009/08/EricMMartin_old.png"><img src="http://www.ericmmartin.com/wordpress/wp-content/uploads/2009/08/EricMMartin_old-300x300.png" alt="Older version of EricMMartin.com" width="300" height="300" /></a></p>
<p>Go ahead and say it, it's OK, the previous version was ugly. Hopefully the new design is easier on the eyes.</p>
<p>As a side note, I'll be starting a series or articles that will cover the redesign and development process in more detail. The articles will focus on topics such as creating a custom WordPress theme, client-side development using jQuery, and website performance. If you are interested in any of those topics, be sure to <a href="http://feeds.ericmmartin.com/emm/">subscribe</a> or bookmark this site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/new-version-of-ericmmartin-com/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery &amp; Browser Issues (revisited)</title>
		<link>http://www.ericmmartin.com/jquery-browser-issues-revisited/</link>
		<comments>http://www.ericmmartin.com/jquery-browser-issues-revisited/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 23:32:25 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=353</guid>
		<description><![CDATA[Back in August, I blogged about "three fairly significant browser issues" I had encountered while using jQuery. With the release of jQuery 1.3, and subsequent minor versions, I thought I'd take a look back at those browser issues and see if any of them had been resolved. IE7 Recap: In certain situations, jQuery’s $.browser.version will [...]]]></description>
			<content:encoded><![CDATA[<p>Back in August, I <a href="http://www.ericmmartin.com/jquery-browser-issues/">blogged</a> about "three fairly significant browser issues" I had encountered while using jQuery. With the release of jQuery 1.3, and subsequent minor versions, I thought I'd take a look back at those browser issues and see if any of them had been resolved.</p>
<p><span id="more-353"></span></p>
<h3>IE7</h3>
<p><strong>Recap:</strong> In certain situations, jQuery’s <code>$.browser.version</code> will report IE 7 as version 6.</p>
<p>Considering the problem is due to IE 7 having an incorrect user-agent, I'm not sure that this problem was up to jQuery to solve. It would have required the user-agent parsing code to check non-user-agent properties...which is probably a bad idea.</p>
<p>I found out that my original code suggestions might fail in situations where IE 6 is using a 3rd party library to add <code>XMLHttpRequest</code> support, so here are my updated IE 6 and IE 7 detection suggestions:</p>
<p>Override the <code>$.browser.version</code> value:</p>
<pre><code>jQuery.browser.version = jQuery.browser.msie &#038;&
    parseInt(jQuery.browser.version) >= 6 &#038;&
    typeof window['XMLHttpRequest'] == "object" ?
        "7.0" :
        jQuery.browser.version;</code></pre>
<p>Add a new <code>msie6</code> property:</p>
<pre><code>jQuery.browser.msie6 = jQuery.browser.msie &#038;&
    parseInt(jQuery.browser.version) == 6 &#038;&
    typeof window['XMLHttpRequest'] != "object";</code></pre>
<p>Keep in mind that <code>$.browser</code> is now deprecated, which means it will go away at some point in a future release. I'm not going to get into the object detection vs browser sniffing debate, but just be aware!</p>
<h3>Opera 9.5</h3>
<p><strong>Recap:</strong> Opera, in an effort to follow standards, changed where it was storing the value for the viewport height.</p>
<p>This issue was fixed in <a href="http://dev.jquery.com/ticket/3117">jQuery Ticket 3117</a> by <a href="http://flesler.blogspot.com/">Ariel Flesler</a>. If you have Opera 9.5, you can test the results on <a href="http://www.ericmmartin.com/code/jquery/3117/">this page</a>.</p>
<h3>Safari 3 (Windows)</h3>
<p><strong>Recap:</strong> The following element would not be hidden in Safari: <code>$("&lt;div/&gt;").hide().appendTo('body');</code></p>
<p>I found out that this issue also occurs in Safari 4! The original jQuery ticket I mentioned was marked as a duplicate, but the issue was fixed in <a href="http://dev.jquery.com/ticket/1239">ticket 1239</a>.</p>
<h3>Summary</h3>
<p>Besides the problems with the IE user-agent, the jQuery developers implemented fixes for the two other browser issues that I had previously blogged about. jQuery 1.3.x has a number of new features and code improvements and continues to be, IMO, the best available JavaScript library. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/jquery-browser-issues-revisited/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery 1.3 and SimpleModal</title>
		<link>http://www.ericmmartin.com/jquery-13-and-simplemodal/</link>
		<comments>http://www.ericmmartin.com/jquery-13-and-simplemodal/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 20:50:56 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SimpleModal]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=337</guid>
		<description><![CDATA[In case you haven't heard, jQuery 1.3 has been released! In addition to being jQuery's 3rd birthday, the team has a number of new announcements, including Sizzle (a brand new CSS selector engine), a new API browser (developed by Remy Sharp) and the formation of the jQuery Foundation. I tested SimpleModal (tests and demos) with [...]]]></description>
			<content:encoded><![CDATA[<p>In case you haven't heard, jQuery 1.3 has been <a href="http://blog.jquery.com/2009/01/14/jquery-13-and-the-jquery-foundation/">released</a>! In addition to being jQuery's 3rd birthday, the team has a number of new announcements, including <a href="http://sizzlejs.com/">Sizzle</a> (a brand new CSS selector engine), a new <a href="http://api.jquery.com">API browser</a> (developed by <a href="http://remysharp.com/">Remy Sharp</a>) and the formation of the jQuery Foundation.</p>
<p>I tested <a href="http://www.ericmmartin.com/projects/simplemodal/">SimpleModal</a> (tests and demos) with jQuery 1.3 and everything seems to be working as expected. After reading about all of the speed improvements, I thought it would be interesting to run some tests (Firebug 1.3 Profiler) comparing the SimpleModal demos with jQuery 1.2.6 and jQuery 1.3:</p>
<table id="comparison">
<thead>
<tr>
<th/>
<th>Basic Modal Dialog</th>
<th>Contact Form</th>
<th>Confirm Override</th>
</tr>
</thead>
<tbody>
<tr>
<td class="heading">jQuery 1.2.6</td>
<td class="result"> 22.472ms | 1126 calls </td>
<td class="result"> 101.547ms | 3805 calls </td>
<td class="result"> 24.03ms | 1094 calls </td>
</tr>
<tr>
<td class="heading">jQuery 1.3</td>
<td class="result"> 19.747ms | 938 calls </td>
<td class="result"> 91.612ms | 3859 calls </td>
<td class="result"> 16.883ms | 914 calls </td>
</tr>
</tbody>
</table>
<p>I haven't looked into why 1.3 has more calls for the Contact Form, but even so, the execution time (ms) has improved for each one!</p>
<p>Congratulations to the jQuery team and Happy Birthday!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/jquery-13-and-simplemodal/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress bug &#8211; duplicate page entries</title>
		<link>http://www.ericmmartin.com/wordpress-bug-duplicate-page-entries/</link>
		<comments>http://www.ericmmartin.com/wordpress-bug-duplicate-page-entries/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 18:16:14 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=288</guid>
		<description><![CDATA[This bug was fixed in WordPress 2.8 [changeset] While working on a new site design, I found an interesting bug in WordPress 2.7. I created two new pages to use as "Front page displays", one called Blog and one called Home. To create the pages, I clicked on Pages > Add New, entered a Title [...]]]></description>
			<content:encoded><![CDATA[<div class="note">This bug was fixed in WordPress 2.8 [<a href="http://core.trac.wordpress.org/changeset/10251">changeset</a>]</div>
<p>While working on a new site design, I found an interesting bug in WordPress 2.7. I created two new pages to use as "Front page displays", one called Blog and one called Home. To create the pages, I clicked on Pages > Add New, entered a Title and clicked Publish.</p>
<p>I then went to my Reading Settings (Settings > Reading) and set the static Front and Posts page to the pages I just created. Going back to my site, I tested out the new static pages only to find they didn't work.</p>
<p><span id="more-288"></span></p>
<p>After a lot of time and troubleshooting, I noticed on the Pages screen that there were two copies of each page I had created - with one still labeled as a Draft. After even more time troubleshooting, I finally discovered the issue. Unlike the Posts page, the Publish and Save Draft buttons are not disabled during an autosave. So, when I entered the Page title and clicked Publish, the autosave and publish requests were happening at the same time.</p>
<p>I opened a WordPress <a href="http://trac.wordpress.org/ticket/8710">ticket</a> and submitted a <a href="http://trac.wordpress.org/attachment/ticket/8710/autosave.patch">patch</a>. The patch was applied by azaozz, but it looks like it won't be available until WordPress 2.8. To fix this bug yourself, open <code>/wp-includes/js/autosave.js</code> and change all occurrences of <code>#submitpost</code> to <code>.submitbox</code>:</p>
<pre><code>function autosave_enable_buttons() {
	jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr('disabled', '');
}

function autosave_disable_buttons() {
	jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr('disabled', 'disabled');
	setTimeout(autosave_enable_buttons, 5000); // Re-enable 5 sec later.  Just gives autosave a head start to avoid collisions.
}
</code></pre>
<p>Now the buttons will be disabled during an autosave, just like it does on the Posts page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/wordpress-bug-duplicate-page-entries/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating a Custom jQuery Selector</title>
		<link>http://www.ericmmartin.com/creating-a-custom-jquery-selector/</link>
		<comments>http://www.ericmmartin.com/creating-a-custom-jquery-selector/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 20:29:07 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=160</guid>
		<description><![CDATA[This isn't a new topic, but I had the need to create a custom jQuery selector today, so I thought I'd share. Whether you are a jQuery newbie or seasoned pro, you know that jQuery has very powerful selectors. In addition to the class and id selectors, there are over 30 selection expressions that use [...]]]></description>
			<content:encoded><![CDATA[<p>This isn't a new topic, but I had the need to create a custom jQuery selector today, so I thought I'd share. Whether you are a jQuery newbie or seasoned pro, you know that jQuery has very powerful <a href="http://docs.jquery.com/Selectors">selectors</a>. In addition to the class and id selectors, there are over 30 selection expressions that use the colon syntax (<code>:first</code>, <code>:even</code>, <code>:hidden</code>, <code>:input</code>, etc.). If one of the existing selectors doesn't fit your needs, jQuery provides you the flexibility to create your own!</p>
<p><span id="more-160"></span></p>
<p>In my situation, I was looking for a selector that would allow me to do an exact search. The scenario: A user enters a value in a text box and submits. The value entered is then used to search a multiple select element for an option element with a text node that is an exact match (case-insensitive).</p>
<p>My solution:</p>
<pre><code>jQuery.extend(jQuery.expr[':'], {
	exactIgnoreCase: "(a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase() == (m[3]).toLowerCase()"
});</code></pre>
<p>If you wanted a case-sensitive selector:</p>
<pre><code>jQuery.extend(jQuery.expr[':'], {
	exact: "a.textContent||a.innerText||jQuery(a).text()||'' == m[3]"
});</code></pre>
<p>The JavaScript implementation:</p>
<pre><code>$("#detail form.find").bind("submit", function (e) {
	 // cancel the submit
	 e.preventDefault();

	// get the search value
	var q = $("#detail form.find input.query");

	// look for a match using the custom selector - only return the first one
	var result = $("#detail select.fields option:exactIgnoreCase(" + q.val() + "):first");

	// if a match was found, select that field (option). Clear the value and focus.
	// otherwise, add a visual clue that nothing was found
	if (result.length > 0) {
		result.attr("selected", true);
		q.removeClass("requiredError").val("").focus();
	}
	else {
		q.addClass("requiredError");
	}
});</code></pre>
<p>Pretty cool, huh!?! Now, try it out for yourself. Here's a template that will help get you started:</p>
<pre><code>jQuery.extend(jQuery.expr[':'], {
	EXPRESSION_NAME: "EXPRESSION_RULE"
});</code></pre>
<p>To get samples of what goes in the EXPRESSION_RULE part, open up the jQuery source, look for "<code>expr: {</code>", then study all of the current expressions in the "<code>":": {</code>" section of the code.</p>
<p>Have you written any custom selectors that you'd like to share?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/creating-a-custom-jquery-selector/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery.com Redesign Causes Pandemonium</title>
		<link>http://www.ericmmartin.com/jquerycom-redesign-causes-pandemonium/</link>
		<comments>http://www.ericmmartin.com/jquerycom-redesign-causes-pandemonium/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:18:04 +0000</pubDate>
		<dc:creator>Eric Martin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.ericmmartin.com/?p=125</guid>
		<description><![CDATA[Sorry, I couldn’t resist the title. Perhaps short of true pandemonium, the new jQuery.com redesign has caused quite a stir. It sounds like they are going to make some changes, so I'm adding a screenshot for historical reference: What was your first initial impression of the redesign? Update: Order has been restored and the Rock [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry, I couldn’t resist the title. Perhaps short of true pandemonium, the <a href="http://jquery.com/blog/2008/08/29/jquerycom-site-redesign/">new jQuery.com redesign</a> has caused quite a stir. It sounds like they are going to <a href="http://jquery.com/blog/2008/08/29/jquery-site-redesign-the-community-speaks/#comment-226080">make some changes</a>, so I'm adding a screenshot for historical reference:</p>
<p><a href="http://www.ericmmartin.com/wordpress/wp-content/uploads/2008/08/jquery_homepage.jpg"><img src="http://www.ericmmartin.com/wordpress/wp-content/uploads/2008/08/jquery_homepage-500.jpg" alt="jQuery.com redesign" title="View fullsize" width="500" height="438" /></a></p>
<p>What was your first initial impression of the redesign?</p>
<p class="note">Update: Order has been <a href="http://www.jquery.com">restored</a> and <a href="http://jquery.com/blog/2008/08/29/death-to-javascript-rock-stars/">the Rock Star is dead!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericmmartin.com/jquerycom-redesign-causes-pandemonium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

