Helgus
Helgus

Reputation: 177

jQuery spinner using issue

what i've wrong? here is code:

<script type="text/javascript"
    src="<c:url value='/resources/js/jquery-1.7.js'/>"></script>
<script type="text/javascript"
    src="<c:url value='/resources/js/jquery-ui-1.8.21.custom.min.js'/>"></script>
<script type="text/javascript"
    src="<c:url value='/resources/js/jquery.ui.spinner.js'/>"></script>
<script type="text/javascript"
    src="<c:url value='/resources/js/myscript.js'/>"></script>

<input id="spinner" type="text" value="0" />

mysript.js code:

$(document).ready(function() {


    $(function() {
        $('#spinner').spinner({min: -100, max: 100});
    });

});

it still doesn't work

btw, it says: TypeError: this._super is not a function

this._super( key, value );

jquery...nner.js (line375)

TypeError: this._super is not a function

this._super( options );

jquery...nner.js (line 389)

Upvotes: 1

Views: 7130

Answers (2)

YangHongChang
YangHongChang

Reputation: 76

you code not any problem,look at:here is you code

Upvotes: 0

JP Hellemons
JP Hellemons

Reputation: 6047

Working example: http://jsfiddle.net/KaaaT/

So you need:

  • jQuery
  • jQuery UI
  • jQuery UI CSS
  • spinner

Click on the manage resources at the jsfiddle link above to see, which URL's I have used for the example.

The jQuery code:

$('#spinner').spinner({ min: -100, max: 100 });

The HTML code:

<input type="text" id="spinner" value="0" />

Jsfiddle uses jQuery UI 1.8.18. Google's Content Delivery Network hosts a newer one. So I suggest that you use these url's:

Edit: The problem is probably that you forgot to add the widget feature to your custom jQuery UI library when you have downloaded it. Try the one hosted by Google's CDN. Or re-download jQuery UI with the widget option checked.

Upvotes: 2

Related Questions