jquery ui – Using jqueryUI spinner – getting started – Education Career Blog

I’m absolutely sure this will be a trivial, newbie question, but hey – what’s stackoverflow for?

I want to make use of the jQueryUI Spinner; and I’d like to grab the required files from Google. I have the following in my <head>:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js" type="text/javascript"></script>

…but when I try $('#sac_inf_241').spinner({max: 3, min:0}) through FireBug’s Console, I get TypeError: $("#sac_inf_241").spinner is not a function. I can only assume I’ve not grabbed the right files from Google, but I don’t know what I should be getting.

Can anyone help?


First: Stackoverflow is where people find answers to programming questions…just like this 🙂

Now for the question: .spinner() isn’t part of jquery UI 1.8, it’s part of jQuery UI 1.9 which isn’t on the Google CDN (because it hasn’t been completed/released yet).

At the time of this answer jQuery UI 1.9 is on it’s milestone 2 release, you can grab it from here: http://jquery-ui.googlecode.com/files/jquery-ui-1.9m2.zip or tagged on Github, here: http://github.com/jquery/jquery-ui/tree/1.9m2 (and you can always find all releases here).

Keep in mind there may be issues, as this isn’t a final/finished release. If you want a more thoroughly tested version, wait for the 1.9 final release.


In the meantime you could try http://plugins.jquery.com/project/spinbox.

Leave a Comment