首页 > 解决方案 > 选择时等待的方法已生成选项

问题描述

我搜索了我在下面使用的方法的替代方法,以等待所选插件在执行操作之前生成所有选项。

var interval = setInterval(function() {
    if($('.chosen-single > span')){
        // do something
        clearInterval(interval);
    }
}, 100);

标签: javascriptjquery-chosen

解决方案


if you can console the $('.chosen-single > span'),and you will know what error occurred.You should use another method to judge the node is shown.


推荐阅读