【问题标题】:cannot call methods on autocomplete prior to initialization; attempted to call method 'option'无法在初始化之前调用自动完成的方法;试图调用方法“选项”
【发布时间】:2016-06-02 07:52:30
【问题描述】:

我正在为我的网站使用标签处理程序插件。我将支持的js放在我初始化方法的js下面。每个 js 都在页脚中。我不知道为什么会出现这个错误。

这里是js:

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

我把它放在document.ready

【问题讨论】:

    标签: javascript jquery tags tag-handler


    【解决方案1】:

    您需要将 JQUERY 库包含到您的项目中,否则它将无法工作。

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

    下载 jquery 并添加到你脑海中的项目

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

    【讨论】:

    • 我会把这一切都放在我的脑海里 1.jquery 2.jquery 插件 3.my script.js,
    猜你喜欢
    • 2014-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多