<?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>JackKozik.com &#187; 1.9 Upgrade</title> <atom:link href="http://jackkozik.com/tag/1-9-upgrade/feed/" rel="self" type="application/rss+xml" /><link>http://jackkozik.com</link> <description>Web Programming, Home Networking and Personal Travel</description> <lastBuildDate>Mon, 04 Sep 2023 14:26:56 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.9.2</generator> <item><title>Updating to jQuery 1.9</title><link>http://jackkozik.com/updating-my-website-to-jquery-1-9/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=updating-my-website-to-jquery-1-9</link> <comments>http://jackkozik.com/updating-my-website-to-jquery-1-9/#comments</comments> <pubDate>Fri, 09 Aug 2013 17:30:56 +0000</pubDate> <dc:creator><![CDATA[Jack Kozik]]></dc:creator> <category><![CDATA[Web Programming]]></category> <category><![CDATA[1.9 Upgrade]]></category> <category><![CDATA[2013]]></category> <category><![CDATA[Jquery]]></category><guid isPermaLink="false">http://jackkozik.com/?p=4579</guid> <description><![CDATA[<p>Background on why I was Updating to jQuery 1.9:  For a number of reasons, I needed to update my website to a newer version of jQuery, jQuery 1.9. My site, designed in 2010 was started on v1.4 and had last been updated to 1.7 in 2011. I knew I had several out-of-date methods and expected [&#8230;]</p><p>The post <a rel="nofollow" href="http://jackkozik.com/updating-my-website-to-jquery-1-9/">Updating to jQuery 1.9</a> appeared first on <a rel="nofollow" href="http://jackkozik.com">JackKozik.com</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Background on why I was Updating to jQuery 1.9:  For a number of reasons, I needed to update my website to a newer version of jQuery, jQuery 1.9. My site, designed in 2010 was started on v1.4 and had last been updated to 1.7 in 2011. I knew I had several out-of-date methods and expected to some debugging and troubleshooting. Well, in the end, it took me 6 hours spread over two days. It wasn&#8217;t really that bad, but since I don&#8217;t upgrade jQuery everyday, I had a little re-learning to go through.</p><p>For starters, I knew that v1.9 had deprecated many of its old methods. In fact, I learned from the <a href="http://jquery.com/upgrade-guide/1.9/">upgrade web page</a>, , that v1.9 comes with a special <a href="https://github.com/jquery/jquery-migrate">migration plug-in</a>. I was pleased to see this and used this to address most all of my updating challenages.</p><p>For example, $.browser() method was deprecated. The migrate script reported this to me in the Chrome console, as follows:</p><p>Chrome console:</p><p><a href="http://jackkozik.com/updating-my-website-to-jquery-1-9/jqmigratebrowser080813/" rel="attachment wp-att-4580"><img class="alignleft size-full wp-image-4580" title="JQMIGRATE:  jQuery.browser is deprecated" alt="" src="http://jackkozik.com/wp-content/uploads/2013/08/JQMIGRATEbrowser080813.png" width="734" height="46" /></a></p><p>With a little digging, I was able to find that I was using an old version of <a href="https://github.com/malsup/blockui">blockUI</a>. When I changed to the new version the warning message went away.</p><p>I also got the following warning messages related to type changing and the change to the <a href="http://api.jquery.com/andSelf/">andSelf()</a> method:</p><p>Chrome console:</p><p><a href="http://jackkozik.com/wp-content/uploads/2013/08/JQMIGRATEtmpl080813.png"><img class="alignleft size-full wp-image-4581" title="JQMIGRATE: jQuery.fn.andSelf() replaced by addBack()" alt="" src="http://jackkozik.com/wp-content/uploads/2013/08/JQMIGRATEtmpl080813.png" width="719" height="35" /></a></p><p>Again, it took a lot of digging, but I was able to isolate the problem to my <a href="https://github.com/KanbanSolutions/jquery-tmpl">tmpl.js</a> script. I was using a really old version. I think with a little more skill on my part, I would better be able to use stack backtraces or some other Chrome tool to find these quicker, but this problem was hard for me to find.</p><p>Since I was also using an old version of jQuery-UI, I stumbled upon a couple of breakages triggered by curCSS:</p><p>Chrome console:</p><p><a href="http://jackkozik.com/wp-content/uploads/2013/08/ErrorcurCSS080813.png"><img class="alignleft size-full wp-image-4582" title="Uncaught TypeError: ... has no method curCSS" alt="" src="http://jackkozik.com/wp-content/uploads/2013/08/ErrorcurCSS080813.png" width="935" height="19" /></a></p><p>For some reason, also, the dialog() method wouldn&#8217;t display text in the &#8220;OK&#8221; button and it would always popup at 0.0 (upper left), so I upgraded to<a href="http://api.jqueryui.com/1.9/"> jQuery-ui v1.9.2</a>.</p><p>One last thing for Updating to jQuery 1.9. I had to <a href="http://jquery.com/upgrade-guide/1.9/#live-removed">change all of my .live() events to .on()</a>. The migration guide clearly covered this.</p><p>Here&#8217;s an example from my website:</p><pre class="brush: jscript; title: ; notranslate">
//$('#journal input').live('keydown', function(evt) {
$(document).on('keydown','#journal input', function(evt) {
</pre><p>This was easy to do; I had to do it in 6 different place, and it worked the first time.</p><p>Updating to jQuery 1.9 was a little more painful than I would like, but feels good to get caught up.</p><p>Ok, now that I&#8217;ve converted to jQuery v1.9, I can try out some of the new things.</p><p>The post <a rel="nofollow" href="http://jackkozik.com/updating-my-website-to-jquery-1-9/">Updating to jQuery 1.9</a> appeared first on <a rel="nofollow" href="http://jackkozik.com">JackKozik.com</a>.</p> ]]></content:encoded> <wfw:commentRss>http://jackkozik.com/updating-my-website-to-jquery-1-9/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>