<?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>Element Design &#187; jQuery</title>
	<atom:link href="http://elementdesignllc.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://elementdesignllc.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 18:58:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>SCRIPT438: Object doesn&#8217;t support property or method &#8216;getElementsByTagName&#8217;</title>
		<link>http://elementdesignllc.com/2011/08/script438-object-doesnt-support-property-or-method-getelementsbytagname/</link>
		<comments>http://elementdesignllc.com/2011/08/script438-object-doesnt-support-property-or-method-getelementsbytagname/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 15:38:18 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=938</guid>
		<description><![CDATA[It was recently brought to my attention that one of my websites was not functioning correctly in Internet Explorer 9. Parts of the page and javascript would load, however the AJAX portions of the site failed to load. Using the F12 Developer tools package with IE9 I was able to find the error: The solution [...]]]></description>
			<content:encoded><![CDATA[<p>It was recently brought to my attention that one of my websites was not functioning correctly in Internet Explorer 9. Parts of the page and javascript would load, however the AJAX portions of the site failed to load.</p>
<p>Using the F12 Developer tools package with IE9 I was able to find the error:</p>
<pre class="brush: plain; title: ; notranslate">
SCRIPT438: Object doesn't support property or method 'getElementsByTagName'
jquery.js, line 16 character 59007
</pre>
<p>The solution is simple, update your jQuery to the <a href="http://jquery.com" target="_blank">latest version</a> (at the time of this writing, 1.6.2). The version I had installed on the website (1.5) is not compatible with IE9.</pre>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2011/08/script438-object-doesnt-support-property-or-method-getelementsbytagname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Validation Word Count Custom Method</title>
		<link>http://elementdesignllc.com/2011/06/jquery-validation-word-count-custom-method/</link>
		<comments>http://elementdesignllc.com/2011/06/jquery-validation-word-count-custom-method/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 20:50:50 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=909</guid>
		<description><![CDATA[The jQuery Validation plugin is one of the best ways to validate your forms client side. It has built in functions to check the maximum amount of characters allowed in each form field, which works great in many situations. However for a project I am currently working on the client requires text areas to have [...]]]></description>
			<content:encoded><![CDATA[<p>The jQuery Validation plugin is one of the best ways to validate your forms client side. It has built in functions to check the maximum amount of characters allowed in each form field, which works great in many situations.</p>
<p>However for a project I am currently working on the client requires text areas to have a word limit instead of a character limit. There are some solutions out there to do this separately from the jQuery Validation plugin, however I decided to write and release a custom method that can be implemented directly into any form.</p>
<h3>The Code</h3>
<p>The following &#8220;addMethod&#8221; needs to be placed after jQuery and jQuery Validation is loaded, but before the actual validation call:</p>
<pre class="brush: jscript; title: ; notranslate">
$.validator.addMethod(&quot;wordCount&quot;,
   function(value, element, params) {
      var typedWords = jQuery.trim(value).split(' ').length;

      if(typedWords &lt;= params[0]) {
         return true;
      }
   },
   jQuery.format(&quot;Only {0} words allowed.&quot;)
);
</pre>
<p>The method first creates the &#8220;typedWords&#8221; variable, which simply counts the amount of spaces on the text area. Then using &#8220;typedWords&#8221; the method checks against the predefined max length (params[0]).</p>
<p>The next code snippet is a sample of how you can call the custom method with your form. For example, I have a textarea named &#8220;comments&#8221; that I want to apply this method to:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#contactform&quot;).validate({
   rules: {
      comments: {
         required: true,
         wordCount: ['10']
      }
   },
});
</pre>
<p>When we call the wordCount method, we can also define the max amount of words allowed. Simply change ['10'] to any number you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2011/06/jquery-validation-word-count-custom-method/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery UI Autocomplete: One Field Searching for First and Last Names</title>
		<link>http://elementdesignllc.com/2011/02/jquery-ui-autocomplete-one-field-searching-for-first-and-last-names/</link>
		<comments>http://elementdesignllc.com/2011/02/jquery-ui-autocomplete-one-field-searching-for-first-and-last-names/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 18:21:07 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=811</guid>
		<description><![CDATA[In the application I&#8217;m working on, jQuery UI Autocomplete is used to search for people using their first and last names. The MySQL statement for retrieving names based on an input value was as follows: This worked fine until I did some usability testing. I found that a lot of users typed in the first AND last [...]]]></description>
			<content:encoded><![CDATA[<p>In the application I&#8217;m working on, <a href="http://jqueryui.com/demos/autocomplete/#multiple" target="_blank">jQuery UI Autocomplete</a> is used to search for people using their first and last names. The MySQL statement for retrieving names based on an input value was as follows:</p>
<pre class="brush: sql; title: ; notranslate">WHERE first_name LIKE :term AND last_name LIKE :term</pre>
<p>This worked fine until I did some usability testing. I found that a lot of users typed in the first AND last name, without looking at the results that were already showing. The SQL statement above worked until they started to type in the last name.</p>
<p>To fix this, I used the <a title="External link" rel="nofollow" href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws">MySQL CONCAT_WS function</a>:</p>
<pre class="brush: sql; title: ; notranslate">CONCAT_WS(' ',first_name,last_name) LIKE :term</pre>
<p>I used CONCAT_WS instead of CONCAT because this added space inbetween the first and last name. Now the one jQuery UI Autocomplete field works as expected when typing out a full name!</p>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2011/02/jquery-ui-autocomplete-one-field-searching-for-first-and-last-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increasing Password Security: Hash with sha256 Client-Side</title>
		<link>http://elementdesignllc.com/2010/12/increasing-password-security-hash-with-sha256-client-side/</link>
		<comments>http://elementdesignllc.com/2010/12/increasing-password-security-hash-with-sha256-client-side/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 17:52:46 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=632</guid>
		<description><![CDATA[An important part of user registration and authentication is the security of their password. A password stored in plain-text, or transfered over the internet in plain-text without the use of a SSL certificate can lead to the theft of the password, posing a security risk to not only the user but to your site as [...]]]></description>
			<content:encoded><![CDATA[<p>An important part of user registration and authentication is the security of their password. A password stored in plain-text, or transfered over the internet in plain-text without the use of a SSL certificate can lead to the theft of the password, posing a security risk to not only the user but to your site as well (especially if the stolen password belongs to an administrator).</p>
<p>An effective way to deal with this is a simple Javascript solution: hashing the password client-side using a jQuery plugin, then transferring that hashed version of the password to server side. To ensure proper security, this script uses sha256, which is a cryptographic hash function developed by the National Security Agency (NSA).</p>
<h3>The Form</h3>
<p>Preparing the HTML form is simple, it only takes 2 fields to make this happen: User Name and Password.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;form name=&quot;user_login&quot; id=&quot;user_login&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
   &lt;label for=&quot;user_name&quot;&gt;User Name&lt;/label&gt;
   &lt;input type=&quot;text&quot; name=&quot;user_name&quot; value=&quot;&quot; /&gt;

   &lt;label for=&quot;user_password&quot;&gt;Password&lt;/label&gt;
   &lt;input type=&quot;password&quot; name=&quot;user_password&quot; id=&quot;user_password&quot; value=&quot;&quot; /&gt;

   &lt;input type=&quot;submit&quot; name=&quot;login&quot; value=&quot;Login&quot; /&gt;
&lt;/form&gt;
</pre>
<h3>The Javascript</h3>
<p>jQuery is required for this to work, be sure to have it included on the top of the page. The plugin for hashing the password can be found at: <a href="http://www.alexweber.com.br/jquery/sha256/jquery.sha256.js">http://www.alexweber.com.br/jquery/sha256/jquery.sha256.js</a></p>
<p>Now however you handle the submit, be sure to run these two lines of code:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#user_password&quot;).val($.sha256($(&quot;#user_password&quot;).val()));
</pre>
<p>The Javascript code finds the plain text value of the password (in the user_password field), hashes it using the plugin we included, then changes the user_password field to that hashed version.</p>
<p>That&#8217;s all there is to it! Before the password even leaves the client&#8217;s machine to the internet, it will now be hashed.</p>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2010/12/increasing-password-security-hash-with-sha256-client-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Performance and Coding Tips</title>
		<link>http://elementdesignllc.com/2010/11/jquery-performance-and-coding-tips/</link>
		<comments>http://elementdesignllc.com/2010/11/jquery-performance-and-coding-tips/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 20:00:36 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=684</guid>
		<description><![CDATA[This is a great article that showcases 50 jQuery Snippets to help you program scripts for your website. It covers basic jQuery functionality and methods, all the way to how to fine-tune your code for increasing website performance. 50 jQuery Snippets That Will Help You Become A Better JavaScript Developer]]></description>
			<content:encoded><![CDATA[<p>This is a great article that showcases 50 jQuery Snippets to help you program scripts for your website. It covers basic jQuery functionality and methods, all the way to how to fine-tune your code for increasing website performance.</p>
<p><a href="http://addyosmani.com/blog/50-jquery-snippets-for-developers/" target="_blank">50 jQuery Snippets That Will Help You Become A Better JavaScript Developer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2010/11/jquery-performance-and-coding-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Validation submitHandler fails silently in Chrome</title>
		<link>http://elementdesignllc.com/2010/10/jquery-validation-submithandler-fails-silently-in-chrome/</link>
		<comments>http://elementdesignllc.com/2010/10/jquery-validation-submithandler-fails-silently-in-chrome/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 18:18:39 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=624</guid>
		<description><![CDATA[There is an odd issue with the jQuery Validation plugin&#8217;s submitHandler callback with Chrome. To validate the form I had my function setup as follows: The alert box and form submitted correctly in Firefox. However in Chrome, the alert box worked, but after that the form refused to submit. I narrowed down the issue to [...]]]></description>
			<content:encoded><![CDATA[<p>There is an odd issue with the jQuery Validation plugin&#8217;s submitHandler callback with Chrome. To validate the form I had my function setup as follows:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#signup_form&quot;).validate({
   submitHandler: function(form) {
      alert(&quot;Test&quot;);
      form.submit();
   }
});
</pre>
<p>The alert box and form submitted correctly in Firefox. However in Chrome, the alert box worked, but after that the form refused to submit. I narrowed down the issue to be with the actual name of the submit input on the form. I had named the submit input &#8220;submit&#8221;, which had some sort of conflict with the plugin. Renaming the submit input to anything else, like &#8220;newname&#8221; fixes the issue.</p>
<p>In short, to fix this, change:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Sign Up&quot; /&gt;
</pre>
<p>to</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;submit&quot; name=&quot;newname&quot; value=&quot;Sign Up&quot; /&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2010/10/jquery-validation-submithandler-fails-silently-in-chrome/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>The Easiest Way to Select All Checkboxes with jQuery</title>
		<link>http://elementdesignllc.com/2009/12/jquery-select-all-checkboxes/</link>
		<comments>http://elementdesignllc.com/2009/12/jquery-select-all-checkboxes/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 17:57:11 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[select all]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=438</guid>
		<description><![CDATA[After looking at many code samples online that were unnecessarily complex I&#8217;ve come up with my own simple method of selecting all checkboxes on a page: You can change the selector to target certain groups of checkboxes. To deselect all checkboxes, simply change the &#8220;true&#8221; to &#8220;false&#8221;:]]></description>
			<content:encoded><![CDATA[<p>After looking at many code samples online that were unnecessarily complex I&#8217;ve come up with my own simple method of selecting all checkboxes on a page:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;:checkbox&quot;).attr(&quot;checked&quot;, true);
</pre>
<p>You can change the selector to target certain groups of checkboxes.</p>
<p>To deselect all checkboxes, simply change the &#8220;true&#8221; to &#8220;false&#8221;:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;:checkbox&quot;).attr(&quot;checked&quot;, false);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2009/12/jquery-select-all-checkboxes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery UI Datepicker Inline Select</title>
		<link>http://elementdesignllc.com/2009/09/jquery-ui-datepicker-inline-select/</link>
		<comments>http://elementdesignllc.com/2009/09/jquery-ui-datepicker-inline-select/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 13:00:33 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[datepicker]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/?p=278</guid>
		<description><![CDATA[It is well documented on the jQuery UI site on how to take a value from Datepicker when calling it from an input field. However when embedding Datepicker on a page (associating it with a div instead of an input field), you have to add a small amount of code to easily capture values from [...]]]></description>
			<content:encoded><![CDATA[<p>It is <a href="http://jqueryui.com/demos/datepicker/" target="_blank">well documented</a> on the jQuery UI site on how to take a value from Datepicker when calling it from an input field. However when embedding Datepicker on a page (associating it with a div instead of an input field), you have to add a small amount of code to easily capture values from it.</p>
<p style="text-align: center;"><img class="size-full wp-image-279  aligncenter" title="Inline Datepicker" src="http://elementdesignllc.com/wp-content/uploads/2009/08/datepicker_inline.png" alt="Inline Datepicker" width="320" height="325" /></p>
<p style="text-align: center;"><a href="http://elementdesignllc.com/demos/datepicker_inline.html" target="_blank">Inline Datepicker Demo</a></p>
<p>The key component to making it work is using the onSelect event. Here is the jQuery code, with &#8220;#datepicker&#8221; as a div:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#datepicker&quot;).datepicker({
   onSelect: function(dateText, inst) {
      $(&quot;#datepicker_value&quot;).val(dateText);
   }
});
</pre>
<p>&#8220;#datepicker_value&#8221; is an input field that is updated every time the user selects a different date. This input field can be easily added to any form for submit. Visit the <a href="http://elementdesignllc.com/demos/datepicker_inline.html" target="_blank">Datepicker demo page</a> for a working example.</p>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2009/09/jquery-ui-datepicker-inline-select/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress &amp; jQuery: &#8220;$ is not a function&#8221;</title>
		<link>http://elementdesignllc.com/2009/08/wordpress-jquery-is-not-a-function/</link>
		<comments>http://elementdesignllc.com/2009/08/wordpress-jquery-is-not-a-function/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 13:00:06 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/blog/?p=139</guid>
		<description><![CDATA[If you are trying to add your own jQuery code to WordPress, and have had the error &#8220;$ is not a function&#8221; show up on Firebug, here is the fix: Convert all dollar signs ($) to &#8216;jQuery&#8217; The dollar sign is reserved in WordPress for the Prototype library, which is why it errors out. For [...]]]></description>
			<content:encoded><![CDATA[<p>If you are trying to add your own jQuery code to WordPress, and have had the error &#8220;<span>$ is not a function&#8221; show up on Firebug, here is the fix:</span></p>
<p><span><strong>Convert all dollar signs ($) to &#8216;jQuery&#8217;</strong></span></p>
<p><span>The dollar sign is reserved in WordPress for the Prototype library, which is why it errors out. For example, instead of</span>:</p>
<pre class="brush: jscript; title: ; notranslate">
$().ready(function() {
   $(&quot;#select_me&quot;).show();
});
</pre>
<p>Change it to:</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery().ready(function() {
   jQuery(&quot;#select_me&quot;).show();
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2009/08/wordpress-jquery-is-not-a-function/feed/</wfw:commentRss>
		<slash:comments>96</slash:comments>
		</item>
		<item>
		<title>Jcrop Large Image Previews</title>
		<link>http://elementdesignllc.com/2009/08/jcrop-large-image-previews/</link>
		<comments>http://elementdesignllc.com/2009/08/jcrop-large-image-previews/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 17:07:36 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[image cropping]]></category>
		<category><![CDATA[jcrop]]></category>

		<guid isPermaLink="false">http://elementdesignllc.com/blog/?p=15</guid>
		<description><![CDATA[Jcrop is an excellent jQuery plugin developed by Deep Liquid. It is used to easily crop images on websites without having to use any photo editing software. There is documentation on their website on how to use boxWidth and boxHeight to deal with large resolution pictures, however it does not tie together those methods with [...]]]></description>
			<content:encoded><![CDATA[<p>Jcrop is an excellent jQuery plugin developed by <a href="http://deepliquid.com/content/Jcrop.html" target="_blank">Deep Liquid</a>. It is used to easily crop images on websites without having to use any photo editing software.</p>
<p>There is documentation on their website on <a href="http://deepliquid.com/content/Jcrop_Sizing_Issues.html" target="_blank">how to use boxWidth and boxHeight</a> to deal with large resolution pictures, however it does not tie together those methods with the preview pane (<a href="http://deepliquid.com/projects/Jcrop/demos.php?demo=thumbnail" target="_blank">visit the demo this post is referencing</a>).</p>
<p>Assuming you are using boxWidth to shrink down the image to 500 pixels wide, with a thumbnail 80 pixels by 80 pixels, use the following code to correctly display the preview pane.</p>
<pre class="brush: jscript; highlight: [13,14,17,18]; title: ; notranslate">
jQuery('#cropbox').Jcrop({
   onChange: showPreview,
   onSelect: updateCoords,
   aspectRatio: 1,
   boxWidth: 500
});

function showPreview(coords) {
   if (parseInt(coords.w) &gt; 0) {
      var rx = 80 / coords.w;
      var ry = 80 / coords.h;

      var img_height = $(&quot;#cropbox&quot;).height();
      var img_width = $(&quot;#cropbox&quot;).width();

      jQuery('#preview').css({
         width: Math.round(rx * img_width) + 'px',
         height: Math.round(ry * img_height) + 'px',
         marginLeft: '-' + Math.round(rx * coords.x) + 'px',
         marginTop: '-' + Math.round(ry * coords.y) + 'px'
     });
   }
};
</pre>
<p>The variables img_height and img_width find the new dimensions of the image, which are unique for images with different dimensions. The variables are then used to make calculations for the width and height of the preview pane.</p>
]]></content:encoded>
			<wfw:commentRss>http://elementdesignllc.com/2009/08/jcrop-large-image-previews/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

