cannot call methods on autocomplete prior to initialization; attempted to call method 'option'

4.8k Views Asked by At

I am using tag handler plugin for my website. and I placed the supportive js beneath the js of mine where I am initializing the method. And every js is in footer. I don't know why i am getting this error.

Here is js:

$("#array_tag_handler").tagHandler({
    assignedTags: [ 'C', 'Perl', 'PHP' ],
    availableTags: [ 'C', 'C++', 'C#', 'Java', 'Perl', 'PHP', 'Python' ],
    autocomplete: true
});

I placed this in document.ready.

1

There are 1 best solutions below

1
On

You need to include the JQUERY library to your project otherwise it would not work.

    $(document).ready(function(){ 
   // ...everything in here is jquery include jquery library..
    });

download jquery and add to project in your head

   <html>
    <head>
    <script scr="jquery.min.js"></script> 
 // to your directory tree 
   </head>