Skip to content

Commit

Permalink
(fix) Various small updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjvantoll committed Jan 31, 2014
1 parent 6cd7fbb commit dedda9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions page/jquery-ui/environments/amd.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Using jQuery UI with AMD
level: intermediate
---

As of jQuery UI 1.11, all of the library's source files support using AMD. This means that you manage your jQuery UI dependencies without using [Download Builder](http://jqueryui.com/download/), and load jQuery UI's source files asynchronously using an AMD loader such as [RequireJS](http://requirejs.org/).
As of jQuery UI 1.11, all of the library's source files support using AMD. This means that you can manage your jQuery UI dependencies without using [Download Builder](http://jqueryui.com/download/), and load jQuery UI's source files asynchronously using an AMD loader such as [RequireJS](http://requirejs.org/).

In this article we'll walk through the process of using AMD with jQuery UI. Let's start by discussing the files we'll need.

Expand All @@ -21,16 +21,16 @@ Now that we have the files we need, we have to discuss where to place them. For
├── index.html
├── js
│   ├── app.js
│   ├── jquery.js
│   ├── require.js
│   └── jquery-ui
│   ├── accordion.js
│   ├── autocomplete.js
│   ├── button.js
│   ├── core.js
│   ├── datepicker.js
│   ├── dialog.js
...
│ ├── ...
│   ├── jquery.js
│   ├── require.js
</pre>

As you can see, we're placing all JavaScript files in a `js` directory. `jquery.js` and `require.js` are direct children of `js`, and all of jQuery UI's files are within a `jquery-ui` directory. `app.js` will contain our application code.
Expand Down Expand Up @@ -103,7 +103,7 @@ require([ "jquery-ui/autocomplete" ], function( autocomplete ) {
Even though we're loading jQuery UI's files with AMD, the files' plugins are still added to the global `jQuery` and `$` objects; therefore you can alternatively use the plugins to instantiate widgets. The following also creates the same autocomplete.

```
require([ "jquery", "jquery-ui/autocomplete" ], function( $, autocomplete ) {
require([ "jquery", "jquery-ui/autocomplete" ], function( $ ) {
$( "<input>" )
.autocomplete({ source: [ "One", "Two", "Three" ]})
.appendTo( "body" );
Expand Down

0 comments on commit dedda9b

Please sign in to comment.