3

I have been tinkering with the jQuery autocomplete, and I got some parts of it to work here: http://problemio.com/test.php

Now I am working from this article: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-use-the-jquery-ui-autocomplete-widget/

And this article says I need to download these libraries: Core, Widget,Position and use their css also.

I already import this on my page:

          <link rel="stylesheet" type="text/css" href="http://jqueryui.com/themes/base/jquery.ui.all.css"/>

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

<script type="text/javascript" src="http://www.problemio.com/js/problemio.js"></script>

so does that mean I need to import some more libraries? Which ones exactly? The example tutorials suggest I download the libraries, what is the main difference between downloading the libraries and just importing them? Also, even if I download them, what should the paths point to since the libraries have more than 1 file?

Thanks!!

4 Answers 4

5

The answer is always in the source,

/*
 * jQuery UI Autocomplete 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Autocomplete
 *
 * Depends:
 *  jquery.ui.core.js
 *  jquery.ui.widget.js
 *  jquery.ui.position.js
 */

And from Autocomplete

The jQuery UI Autocomplete plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.autocomplete.css stylesheet that can be modified. These classes are highlighed in bold below.

I recommend reading the Getting Started info before continuing.

2
  • 1
    As they say: "Luke, use the source."
    – Matt Ball
    Oct 28, 2011 at 14:10
  • For UI version 1.9, you need jquery.ui.menu.js, too (new source).
    – yndolok
    Feb 23, 2013 at 22:04
2

No. Core, widget, etc are included in the jQuery-ui. You can include them separately if you want to reduce the amount of code loaded but loading from the Google CDN is pretty efficient.

1

Those are the different components of jQuery UI, which you can see and customize a download for on this page. You're linking against the Google CDN's version, which probably contains all of them, so you have all you need already.

1

To use the JQuery UI autocomplete plugin, you have everything you need to get started in the code you posted. You only need additional files if you're trying to more than the stock auto-complete action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.