<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Blog-O! (Posts about jquery-ui)</title><link>https://bwinton.github.io/weblog.latte.ca/</link><description></description><atom:link rel="self" href="https://bwinton.github.io/weblog.latte.ca/tags/jquery-ui.xml" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sat, 13 Apr 2019 21:03:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Requiring jQuery UI.</title><link>https://bwinton.github.io/weblog.latte.ca/blake/employment/mozilla/jqueryui/</link><dc:creator>Blake Winton</dc:creator><description>&lt;div&gt;&lt;p&gt;Yesterday afternoon, I watched &lt;a href="https://air.mozilla.org/apps-templates-dev-ecosystem-tools/"&gt;a video&lt;/a&gt; from &lt;a href="https://twitter.com/jlongster"&gt;James Long&lt;/a&gt; about &lt;a href="https://github.com/mozilla/mortar"&gt;Mortar&lt;/a&gt;, which is a template for making HTML 5 Open Web Apps.  Now, coincidentally, I’m starting a new project (in my spare time, obviously, since it’s a Sunday), and while it’s not an Open Web App, I saw no reason not to use the &lt;a href="https://github.com/volojs/volo"&gt;same&lt;/a&gt; &lt;a href="http://requirejs.org/"&gt;tools&lt;/a&gt; they were using.&lt;/p&gt;
&lt;p&gt;Of course, since nothing’s easy, I ran into a problem pretty quickly.  My problem was that every time I tried to &lt;code&gt;require("jquery-ui");&lt;/code&gt;, I got an error of “ReferenceError: jQuery is not defined”.  There wasn’t a lot of information about how to fix it, so after most of an afternoon mucking around, I finally came up with something that seems to work, and thought I would post it.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go into your &lt;code&gt;www/js/lib&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;curl -O https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Edit the jquery-ui.js file.  At the top add the line &lt;code&gt;define(["jquery"], function (jQuery) {&lt;/code&gt;, and at the bottom, add the line &lt;code&gt;});&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;That’s it.  From there you should be good to go!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, I suspect there’s a better way to do this, and hopefully &lt;a href="https://twitter.com/jrburke"&gt;James&lt;/a&gt; or &lt;a href="https://twitter.com/clarkbw"&gt;Bryan&lt;/a&gt; will jump in the comments and tell me what it is, but for now, at least this works.&lt;/p&gt;&lt;/div&gt;</description><category>jquery-ui</category><category>mozilla</category><category>requirejs</category><guid>https://bwinton.github.io/weblog.latte.ca/blake/employment/mozilla/jqueryui/</guid><pubDate>Sun, 08 Jul 2012 22:14:31 GMT</pubDate></item></channel></rss>