Search code examples
jqueryjquery-uijquery-toolsjquery-tokeninput

How to include both of `jquery.tools.js` and `jquery.tokeninput.js`


Possible Duplicate:
Can JQuery UI and JQuery tools work together?

I have a page which requires JQuery's tokeninput (for drop-downs) and also JQuery's "tools" (for tooltips etc.)

If I do

<script type="text/javascript" src="jquery.tools.js"></script>
<script type="text/javascript" src="jquery.tokeninput.js"></script>

Then Chrome gives me the error:

Uncaught TypeError: Object function (a,b){return new c.fn.init(a,b)} 
has no method 'type'    (jquery.tokeninput.js:139)

If I put the JS calls the other way around, then everything loads, but the tokeninput method is not available on the textfields.

If I have just the jquery.tokeninput.js file then the tokeninput works well, everything is OK, apart from the features introduced in jquery.tools.js aren't available, such as tooltip.

FYI: My entire list of scripts that I include are:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery-1.8.10-redmond/js/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="jquery.tools.js"></script>
<script type="text/javascript" src="jquery.tokeninput.js"></script>
<script type="text/javascript" src="jquery.colorbox.js"></script>
<script type="text/javascript" src="jquery.fileinput.js"></script>

Solution

  • OK the answer appears to be here:

    https://stackoverflow.com/a/1721944/220627