<?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>Ryan Stemkoski &#187; jQuery</title>
	<atom:link href="http://www.stemkoski.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stemkoski.com</link>
	<description>Web design tips &#38; tricks plus anything else I want to talk about...</description>
	<lastBuildDate>Sat, 07 Jan 2012 18:34:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Make a Cross Domain AJAX Request with jQuery</title>
		<link>http://www.stemkoski.com/how-to-make-a-cross-domain-ajax-request-with-jquery/</link>
		<comments>http://www.stemkoski.com/how-to-make-a-cross-domain-ajax-request-with-jquery/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 22:04:37 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Cross Domain]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1522</guid>
		<description><![CDATA[I am currently working on a project that required me to make a cross-domain AJAX request using jQuery. This is a function that is disabled by default because of security implications, however, there is occasionally a need for this type of request. In this case, I need to load content from a remote URL or [...]


Related posts:<ol><li><a href='http://www.stemkoski.com/how-to-get-fixed-header-and-footer-toolbars-in-jquery-mobile-1-0/' rel='bookmark' title='Permanent Link: How to get Fixed Header and Footer Toolbars in jQuery Mobile 1.0'>How to get Fixed Header and Footer Toolbars in jQuery Mobile 1.0</a> <small>At Zipline Interactive, we have been doing mobile websites for...</small></li>
<li><a href='http://www.stemkoski.com/accurate-cross-browser-testing-with-browserstack-com/' rel='bookmark' title='Permanent Link: Accurate Cross Browser Testing With BrowserStack.com'>Accurate Cross Browser Testing With BrowserStack.com</a> <small>The worst job for any web developer is testing your...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I am currently working on a project that required me to make a cross-domain AJAX request using jQuery.  This is a function that is disabled by default because of security implications, however, there is occasionally a need for this type of request.  In this case, I need to load content from a remote URL or website similar to how you would load content using jQuery&#8217;s .load() function or using PHP&#8217;s file_get_contents() function.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/********************************************************************************
FUNCTION FOR CROSS DOMAIN AJAX REQUEST USING JQUERY 1.5+
********************************************************************************/</span>  
<span style="color: #003366; font-weight: bold;">function</span> loadContents<span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
    <span style="color: #006600; font-style: italic;">//CONFIRM A URL WAS PROVIDED  </span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
	    <span style="color: #006600; font-style: italic;">//SET URL FOR YAHOO YQL QUERY</span>
	    <span style="color: #003366; font-weight: bold;">var</span> yql <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://query.yahooapis.com/v1/public/yql?q='</span> <span style="color: #339933;">+</span> encodeURIComponent<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select * from html where url=&quot;'</span> <span style="color: #339933;">+</span> url <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;format=xml&amp;callback=?'</span><span style="color: #339933;">;</span>  
&nbsp;
		<span style="color: #006600; font-style: italic;">//MAKE YAHOO YQL QUERY  </span>
	   	$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>yql<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//BUILD CALLBACK FUNCTION</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> callback <span style="color: #339933;">===</span> <span style="color: #3366CC;">'function'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
			    callback<span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">results</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
			<span style="color: #009900;">&#125;</span>  
&nbsp;
		<span style="color: #006600; font-style: italic;">//WRITES ERROR TO LOG	</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">error</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>jqXHR<span style="color: #339933;">,</span> textStatus<span style="color: #339933;">,</span> errorThrown<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	    	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>errorThrown<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  	<span style="color: #006600; font-style: italic;">//LOG ERROR IF NO URL WAS PASSED TO THE SCRIPT</span>
  	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
  		 console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'No site was passed to the script.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">/********************************************************************************
SAMPLE USAGE
********************************************************************************/</span> 
loadContents<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://www.ziplineinteractive.com/frame/'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#wrapper'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I have tested this function in IE, Firefox, Chrome, and Safari and it should allow you to make cross-domain AJAX requests in jQuery 1.3, 1.4, 1.5, 1.6, 1.7, and from what I been able to find online it should also be supported in 1.8, although, 1.8 is not available at this time.</p>
<p>Let me know how this works in your application.</p>


<p>Related posts:<ol><li><a href='http://www.stemkoski.com/how-to-get-fixed-header-and-footer-toolbars-in-jquery-mobile-1-0/' rel='bookmark' title='Permanent Link: How to get Fixed Header and Footer Toolbars in jQuery Mobile 1.0'>How to get Fixed Header and Footer Toolbars in jQuery Mobile 1.0</a> <small>At Zipline Interactive, we have been doing mobile websites for...</small></li>
<li><a href='http://www.stemkoski.com/accurate-cross-browser-testing-with-browserstack-com/' rel='bookmark' title='Permanent Link: Accurate Cross Browser Testing With BrowserStack.com'>Accurate Cross Browser Testing With BrowserStack.com</a> <small>The worst job for any web developer is testing your...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/how-to-make-a-cross-domain-ajax-request-with-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to get Fixed Header and Footer Toolbars in jQuery Mobile 1.0</title>
		<link>http://www.stemkoski.com/how-to-get-fixed-header-and-footer-toolbars-in-jquery-mobile-1-0/</link>
		<comments>http://www.stemkoski.com/how-to-get-fixed-header-and-footer-toolbars-in-jquery-mobile-1-0/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 13:23:09 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mobile Apps]]></category>
		<category><![CDATA[Mobile Websites]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery Mobile]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1457</guid>
		<description><![CDATA[At Zipline Interactive, we have been doing mobile websites for a number of years. When we originally started building them, most customers were satisfied with a very simple website but as the mobile market has grown and more and more users have smartphones, many customers expect their mobile website to function much like a mobile [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stemkoski.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-23-at-5.28.58-AM.png"><img src="http://www.stemkoski.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-23-at-5.28.58-AM.png" alt="" title="Screen Shot 2011-11-23 at 5.28.58 AM" width="266" height="288" class="alignright size-full wp-image-1461" style="margin-left: 10px;" /></a>At Zipline Interactive, we have been doing mobile websites for a number of years. When we originally started building them, most customers were satisfied with a very simple website but as the mobile market has grown and more and more users have smartphones, many customers expect their mobile website to function much like a mobile app.   In addition, tools like PhoneGap and Appcelerator have provided web developers with the ability to create cross platform mobile applications using HTML5 and Javascript.  The key with developing mobile websites or applications using web technologies, is mimicking the devices user interface and animations for a consisten user experiene.  There are a number of great Javascript frameworks designed to assist with this task.  As I have worked with and tested these platforms my clear favorite is jQuery Mobile. It has a great deal of momentum and support, plus I am already a heavy jQuery user so the learning curve is very low. </p>
<p>One of the the biggest problems facing mobile web developers is the ability to create fixed headers and footers on mobile websites and HTML5 powered mobile applications.  The problem is caused by the lack of standard support for the CSS properties position:fixed and overflow.  Originally, these were not supported because they interfered with the touch interactions of the phone operating system but as of iOS5 and Android 2.1 there is rudimentary support for position:fixed. If you would like to see the level of support for these properties in the various mobile browsers, there is a handy chart available here: http://e.com/css-fixed. </p>
<p>The good news is that default support is on the way.  The bad news is that it is not here yet.  Regardless of the mobile platform you are targeting, there will be a large percentage of users that are unable to use your interface properly if you rely on position:fixed or overflow.  In jQuery Mobile, there is a default solution.  They have built in toolbars that mimic a fixed header and footer by fading out and repositioning as the screen moves.  While this is an improvement, it is still not a solution for a developer wanting a native app look and feel.</p>
<h2>So what is the solution?</h2>
<p>After a great deal of research and testing I found there were two primary solutions for this problem being used by fans of the jQuery Mobile platform.  They both use Javascript to modify the elements and mimic the scrolling functionality of a native application. </p>
<h3>Solution 1: iScroll jQuery Mobile Plugin</h3>
<p>URL: https://github.com/yappo/javascript-jquery.mobile.iscroll<br />
This jQuery Mobile plugin is a wrapper for the iScroll Javascript function. (http://cubiq.org/iscroll-4)  This plugin is made up of a single file that drops in to your HTML and then is initiated by adding &#8216;data-iscroll=&#8221;scroller&#8221;&#8216; to the element you want to scroll.  This plugin was very easy to setup and worked, however, the animation was slow on android applications and when loading websites on the iPhone I had a persistent space at the bottom of the page that I could not remove.  I believe it was caused during loading by the default iPhone toolbars but I am uncertain. I searched online and wasn&#8217;t able to find a suitable solution.  Many users have reported this solution worked well for them and several indicated they were using it successfully with the PhoneGap platform.</p>
<h3>Solution 2: Scrollivew</h3>
<p>URL: http://jquerymobile.com/test/experiments/scrollview/<br />
Download URL: https://github.com/jquery/jquery-mobile/tree/master/experiments/scrollview<br />
This jQuery Mobile plugin is actually sponsored by jQuery and is currently listed under their experiments section on the jQuery Mobile website.  It was a bit harder to get running.  It required 4 files, 3 Javascript files and 1 CSS file, although, I was able to lump them together into existing application files to minimize HTTP requests.  This solution worked very well for my application. After installing the scripts I simply added  data-scroll=&#8221;true&#8221; to the element I wanted scrollable and the plugin took care of the rest.  One important thing to note about this solution, is that in addition to simple fixed toolbars, this plugin also allows scrolling of on page elements left or right and can also handle scrollable lists with inline headers.</p>
<h2>My Conclusion:</h2>
<p>After extensively testing both of the primary scrolling options for jQuery Mobile I feel like the jQuery Mobile Scrollview is the best solution.  It was very easy to install and configure, offered great support on iPhone and Android devices, and has more options and configurations available to customize your application.  In addition, it may at some point be integrated into jQuery mobile as default functionality to serve as a bridge until position:fixed and overflow are full supported by the majority of active smartphones.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/how-to-get-fixed-header-and-footer-toolbars-in-jquery-mobile-1-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Software to Automatically Make a HTML version of a Dynamic Website</title>
		<link>http://www.stemkoski.com/software-to-automatically-make-a-html-version-of-a-dynamic-website/</link>
		<comments>http://www.stemkoski.com/software-to-automatically-make-a-html-version-of-a-dynamic-website/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 14:00:07 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zipline]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Website Backup]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1351</guid>
		<description><![CDATA[It seems like there are a million different content management systems out there. Some like the ZLCMS system we use at Zipline are transferrable to another web host but occasionally we have run into web development companies with ‘proprietary’ content management systems. Many of these companies won’t allow their customers to transfer their website to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>It seems like there are a million different content management systems out there.  Some like the ZLCMS system we use at Zipline are transferrable to another web host but occasionally we have run into web development companies with ‘proprietary’ content management systems. Many of these companies won’t allow their customers to transfer their website to another hosting company. Often, when we run into these situations the customers are willing to forfeit their content management just to get away from the web development company they are working with.  On a few of these occasions we have been forced to hand backup an entire HTML website, updating images, links, etc.</p>
<p>Years ago I had a software program that would copy down an entire HTML site fairly accurately.  Unfortunately, as the web transitioned to dynamic websites this software package could not keep up with the advances.</p>
<p>Today, I discovered a website backup utility that has done a fantastic job in my tests.   I backed up several of our complicated dynamic websites and it has done a great job making them work in an HTML version.  If you run into a situation where your website, or your customers website is being held hostage by a web design company this could be the perfect solution for you.</p>
<p>The software is called HTTrack Website Copier and it is a free GPL licensed software package.</p>
<h3><a href="http://download.httrack.com/cserv.php3?File=httrack.exe">Click here to download HTTrack</a></h3>
<p></p>
<p>If you have any comments or questions please leave a comment below. </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/software-to-automatically-make-a-html-version-of-a-dynamic-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Detect IE6 Browser with JavaScript</title>
		<link>http://www.stemkoski.com/how-to-detect-ie6-with-javascript/</link>
		<comments>http://www.stemkoski.com/how-to-detect-ie6-with-javascript/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:20:56 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Browser Detection]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Internet Explorer 6]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1306</guid>
		<description><![CDATA[I have been doing a lot of work with jQuery lately. The jQuery library offers great cross browser support for most functions but unfortunately even this magic wand can’t solve all the problems with Internet Explorer 6 (IE6) compatibility. Previously, jQuery had a browser() function that helped detect a browser so that a developer could [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I have been doing a lot of work with jQuery lately. The jQuery library offers great cross browser support for most functions but unfortunately even this magic wand can’t solve all the problems with Internet Explorer 6 (IE6) compatibility. Previously, jQuery had a browser() function that helped detect a browser so that a developer could build  a work around. The browser() function has been removed in favor of a new function called support() which helps determine if the current browser offers support for a specific piece of functionality.  For many tasks this strategy works just fine but I have found some occasions where I need to sniff out IE6 and it can be done easily using standard JavaScript.</p>
<h3>JavaScript function to determine if the current browser is IE6:</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//CHECK FOR IE6</span>
<span style="color: #003366; font-weight: bold;">function</span> is_ie6<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">XMLHttpRequest</span> <span style="color: #339933;">==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>ActiveXObject <span style="color: #339933;">!=</span> undefined<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>There are many other ways to find IE6 but this one works great.  If you have another good method please list it in the comments below.  </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/how-to-detect-ie6-with-javascript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A Little Known List of JavaScript Functions Equivalent to PHP Functions in jQuery</title>
		<link>http://www.stemkoski.com/a-little-known-list-of-javascript-functions-equivalent-to-php-functions-in-jquery/</link>
		<comments>http://www.stemkoski.com/a-little-known-list-of-javascript-functions-equivalent-to-php-functions-in-jquery/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 14:18:30 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.jQuery.map()]]></category>
		<category><![CDATA[array_map()]]></category>
		<category><![CDATA[array_merge()]]></category>
		<category><![CDATA[array_unique()]]></category>
		<category><![CDATA[get_object_vars()]]></category>
		<category><![CDATA[in_array()]]></category>
		<category><![CDATA[is_array()]]></category>
		<category><![CDATA[jQuery.each()]]></category>
		<category><![CDATA[jQuery.extend()]]></category>
		<category><![CDATA[jQuery.grep()]]></category>
		<category><![CDATA[jQuery.inArray()]]></category>
		<category><![CDATA[jQuery.isArray()]]></category>
		<category><![CDATA[jQuery.makeArray()]]></category>
		<category><![CDATA[jQuery.merge()]]></category>
		<category><![CDATA[jQuery.unique()]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1212</guid>
		<description><![CDATA[Many of us PHP developers often find working with JavaScript arrays to be a frustrating task. PHP has a number of very powerful built in functions like: in_array(), is_array(), array_merge(), array_map(), and array_unique() that are just plain missing in JavaScript. Over the years, many of these functions have been ported into JavaScript buy developers much [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Many of us PHP developers often find working with JavaScript arrays to be a frustrating task. PHP has a number of very powerful built in functions like: <strong>in_array(), is_array(), array_merge(), array_map(), and array_unique()</strong> that are just plain missing in JavaScript.  Over the years, many of these functions have been ported into JavaScript buy developers much like us. In fact, I recently did a port partial port of the PHP strip_tags() function to JavaScript.  (Note: There is a popular library of PHP->JS functions called PHP.JS you can check out for functions not included in this example or if you are not using jQuery.)</p>
<p>Until now, developers working with arrays in JavaScript were either forced to obtain the data returned from these functions on their own or spend a great deal of time searching the net for a solution that actually works.  Thankfully, the jQuery developers have written a number of these functions into the core jQuery library but for some reason not many developers, even those using jQuery don’t know they are there to use!</p>
<h3>jQuery / JavaScript PHP Equivalent Array Functions</h3>
<p></p>
<p><strong>PHP in_array() Equivalent in JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">inArray</span><span style="color: #009900;">&#40;</span>value<span style="color: #339933;">,</span>array<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>PHP is_array() Equivalent in JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">isArray</span><span style="color: #009900;">&#40;</span>array<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>PHP array_map() Equivalent in JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span>array<span style="color: #339933;">,</span>callback<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong><br />
PHP array_merge() Equivalent in JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">merge</span><span style="color: #009900;">&#40;</span>array1<span style="color: #339933;">,</span>array2<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>PHP array_unique () Equivalent in JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">unique</span><span style="color: #009900;">&#40;</span>array<span style="color: #009900;">&#41;</span></pre></div></div>

<p></p>
<h3>Other jQuery / JavaScript Array and Object Functions</h3>
<p>
In addition to these functions there are some other handy functions available to jQuery developers that work with Arrays and Objects. These include:</p>
<p><strong>PHP get_object_vars() Equivalent in JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">makeArray</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>Grep Style Search Function</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">grep</span><span style="color: #009900;">&#40;</span>array<span style="color: #339933;">,</span>callback<span style="color: #339933;">,</span>invert<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>Object Extension</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>deep<span style="color: #339933;">,</span>target<span style="color: #339933;">,</span>object1<span style="color: #339933;">,</span>objectN<span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>Iterator Function</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">each</span> <span style="color: #009900;">&#40;</span>object<span style="color: #339933;">,</span>callback<span style="color: #009900;">&#41;</span></pre></div></div>

<p><em>(Note: None of these functions will work without the jQuery library. jQuery is a free, open source JavaScript library check out: <a href="http://jquery.com/">http://jquery.com/</a> for more information.)</em></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/a-little-known-list-of-javascript-functions-equivalent-to-php-functions-in-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery UI 1.7.2 Themes List at Google Code</title>
		<link>http://www.stemkoski.com/jquery-ui-1-7-2-themes-list-at-google-code/</link>
		<comments>http://www.stemkoski.com/jquery-ui-1-7-2-themes-list-at-google-code/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 17:07:26 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[jQuery UI Themes]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1195</guid>
		<description><![CDATA[Working with jQuery UI for the first time and looking for a theme? Tired of using the same theme over and over again? Google hosts a number of pre-constructed jQuery UI themes on their Google Code repository. I have always used the same handful of themes with every jQuery UI project I have done. Today, [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Working with jQuery UI for the first time and looking for a theme?  Tired of using the same theme over and over again? Google hosts a number of pre-constructed jQuery UI themes on their Google Code repository. I have always used the same handful of themes with every jQuery UI project I have done.  Today, I had a project that didn’t really fit with any of my established themes and didn’t feel like going through the process of construction my own.  I always use the Google Code repository when accessing common libraries and I know they have a number of themes stored and available for use, however, this list was quite difficult to find. For some reason Google search was unable to find this list of themes, also at Google. </p>
<p>To make life easier on the rest of you, I have compiled a complete list of themes for jQuery UI 1.7.2 below. I have not tested all of these in a live environment but they are all available in the SVN repository.</p>
<h3>jQuery UI Themes:</h3>
<p></p>
<p><strong>Base:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Black Tie</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/black-tie/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Blitzer</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/blitzer/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Cupertino</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Dark Hive</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/dark-hive/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Dot Luv</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/dot-luv/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Eggplant</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/eggplant/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Excite Bike</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/excite-bike/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Flick</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/flick/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Hot Sneaks</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/hot-sneaks/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Humanity</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/humanity/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Le Frog</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/le-frog/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Mint Chocolate</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/mint-choc/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Overcast</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/overcast/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Peper Grinder</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/pepper-grinder/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Redmond</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Smoothness</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>South Street</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/south-street/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Start</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Sunny</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/sunny/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Swanky Purse</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/swanky-purse/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Trontastic</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/trontastic/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>UI Darkness</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>UI Lightness</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p><strong>Vader</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/vader/jquery-ui.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/jquery-ui-1-7-2-themes-list-at-google-code/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Problem with jQuery UI Datepicker and Copied Dynamic DOM: Solved</title>
		<link>http://www.stemkoski.com/problem-with-jquery-ui-datepicker-dynamic-dom/</link>
		<comments>http://www.stemkoski.com/problem-with-jquery-ui-datepicker-dynamic-dom/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 19:10:50 +0000</pubDate>
		<dc:creator>Ryan Stemkoski</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Date Picker]]></category>
		<category><![CDATA[datepicker]]></category>
		<category><![CDATA[jQuery UI]]></category>

		<guid isPermaLink="false">http://www.stemkoski.com/?p=1190</guid>
		<description><![CDATA[Today, I ran into an interesting problem with the jQuery UI Datepicker, for which I couldn’t find any assistance. In retrospect, it was a fairly simple issue but it took me quite awhile to debug. If I didn’t have Firebug, I don’t think it would’ve ever been solved this issue. I spent a great deal [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Today, I ran into an interesting problem with the jQuery UI Datepicker, for which I couldn’t find any assistance. In retrospect, it was a fairly simple issue but it took me quite awhile to debug. If I didn’t have Firebug, I don’t think it would’ve ever been solved this issue. I spent a great deal of time searching for solutions on Google but unfortunately nobody was able to help me solve my problem so I thought I would document this here for anyone else in the same shoes.<br />
<strong><br />
What I was up to:</strong><br />
I was trying to create a dynamic address section.  I was using some simple jQuery to copy a section of code (.address_template) and then I was using jQuery to inject it into the document. The goal was to allow the user to add an unlimited number of previous addresses, each with a start and end date selectable using the jQuery UI datepicker.</p>
<p><strong>The problem:</strong><br />
In my document, I was using jQuery to create instances of datepicker() for each  instance of .address_date.  This worked great for the single instance that appeared but failed miserably for elements added dynamically to the DOM after the page had loaded. I tried various solutions I found for similar problems other users had. Some of these included:</p>
<p>- Adding a unique ID to each instance of the datepicker.<br />
- Using datepicker(“destroy”) then redeclaring datepicker()</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">#<span style="color: #009900;">&#40;</span>‘address_template’<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">datepicker</span><span style="color: #009900;">&#40;</span>‘destroy’<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">datepicker</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This technique works excellent if all of your elements were added properly to DOM but I discovered another but I wasn’t expecting.</p>
<p><strong>What I was doing wrong:</strong><br />
I was copying the HTML after the datepicker(); had been initially added to the template.  This means I was copying the HTML after the datepicker() function had modified it.  Before I spent some time analyzing the HTML with Firebug I didn’t realize that the datepicker() function actually modifies the HTML adding in its own class .hasDatepicker.</p>
<p>When I copied the HTML I was copying the HTML after this class was added so the jQuery UI failed when trying to initiate a new datepicker(); and datepicker(“destroy”); failed because a true instance didn’t exist. I was caught in a real catch 22. </p>
<p>How I solved the problem:<br />
I modified my code to reset the style of the .address_date class when I added it into the DOM prior to adding datepicker to that specific element. As soon as I did this it began to work sweet.</p>
<p>Below is an example of my code in case it is helpful to anyway. This one is really more about theory than exact code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#addaddress'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> count <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.address_template'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> html <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.address_template'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#addaddress'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=&quot;address_template&quot;&gt;'</span> <span style="color: #339933;">+</span> html <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.address_template H1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Previous Address &quot;</span> <span style="color: #339933;">+</span> count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.address_date'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;class&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;address_date&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.address_date'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;movein&quot;</span> <span style="color: #339933;">+</span> count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#movein&quot;</span> <span style="color: #339933;">+</span> count<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">datepicker</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Also here are the reference posts from  stackoverflow that helped me reach my solution:<br />
1. <a href="http://stackoverflow.com/questions/34790/duplicating-jquery-datepicker/1423156#1423156">http://stackoverflow.com/questions/34790/duplicating-jquery-datepicker/1423156#1423156</a></p>
<p>2. <a href="http://stackoverflow.com/questions/1059107/why-does-jquery-uis-datepicker-break-with-a-dynamic-dom">http://stackoverflow.com/questions/1059107/why-does-jquery-uis-datepicker-break-with-a-dynamic-dom</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.stemkoski.com/problem-with-jquery-ui-datepicker-dynamic-dom/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

