错误-无法读取未定义的属性“提示”

时间:2019-12-09 11:15:26

标签: javascript jquery twitter-bootstrap-3 bootstrap-modal

我正在工作一段时间的网站上出现了一个错误。我对此事进行了彻底的调查,但没有解决的可能性。 此外,我将尝试向您展示如何加载引导程序文件,css和js文件的顺序和位置,如果这在某种程度上有所帮助并旨在解决相关问题。

    <!--CSS styles here-->
    <link rel="stylesheet" href="/css/bootstrap.min.css"> 
    <link rel="stylesheet" href="/css/ui-lightness/jquery-ui-1.8.23.custom.css">        
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="/css/styles_omatech.css?v=2">        
    <link rel="stylesheet" href="/css/shadowbox/shadowbox.css">        
    <link rel="stylesheet" href="/css/dcsmt.css">
    <link rel="stylesheet" href="/css/goalProgress.css">  
    <link rel="stylesheet" href="/js/intl-tel-input/build/css/intlTelInput.css?1.0.2">        
    <link rel="stylesheet" href="/css/admin/sweetalert.css">        
    <link rel="stylesheet" href="/css/font-awesome.css">
    <link rel="stylesheet" href="/css/awesome-bootstrap-checkbox.css"> 
    <link rel="stylesheet" href="/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="/css/bootstrap-slider.css">
    <link rel="stylesheet" href="/css/share/jquery.share.css">
    <link rel="stylesheet" href="/css/star-rating.css">
    <link rel="stylesheet" href="/css/style.css?v=1.1.7">
    <link rel="stylesheet" href="/css/media.css?v=1.0.8">
    <link rel="stylesheet" href="/css/main_nav_bar/style.css?v=201811120006">
    <link rel="stylesheet" href="https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.css"> 
   <!-- Library AOS (Animation On Scroll) -->
    <link rel="stylesheet" href="/css/td_line_icons/css/td_line_icons.css" />

    <!--JS here-->
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'></script>
    <script src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'> 
    </script>
    <script src="https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.js"></script>

    <script src='/js/fabric.js'></script>
    <script src='/js/theme.js?v=1.2.1'></script>
    <script src='/js/jquery.lazyload.min.js'></script>
    <script src='/js/legacy.min.js'></script>
    <script src='/js/to_top.js'></script>
    <script src='/js/to_top.js'></script>
    <script src='/js/star-rating.min.js'></script>
    <script src='/js/share/jquery.share.js?v=2'></script>
    <script src='/js/admin/sweetalert.min.js'></script>
    <script src='/js/goalProgress.min.js'></script>
    <script src='/js/intl-tel-input/build/js/intlTelInput.js?1.0.1'></script>

    <!-- Bootstrap JS -->
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/bootstrap-select.min.js"></script>
    <script src="/js/bootstrap-slider.js"></script>

这是我加载CSS和JS的顺序。首先,我加载jquery,然后导入bootstrap js。 尽管如此,我认为这个问题与引导程序模式有关,因为它总是出现在使用该模式的页面上。

function init_popover(id, event, data_relocation){
if (event == null) { /// DEFAULT
    $(id).popover({
        html: true,
        container: id + '_container',
        placement: 'bottom',
        content: function () {
            return $(id + '_content .popover-body').html();
        }
    }).data('bs.popover').tip().attr('data-relocation', data_relocation); // Error appears here
}else if (event == 'focus') { /// Focus event
    $(id).popover({
        html: true,
        container: id + '_container',
        placement: 'bottom',
        content: function () {
            return $(id + '_content .popover-body').html();
        }
    }).on("focus", function () {
        $(this).popover("show");
    }).on("blur", function () {
        $(this).popover("hide");
    }).data('bs.popover').tip().attr('data-relocation', data_relocation); // Error appears here
} else if (event == 'hover'){ /// Evento HOVER (popover doctor results)
    $(id).popover({
        html: true,
        trigger: 'manual',
        container: id + '_container',
        placement: function (context, id) {
            var container_offset_top = $(id).offset().top; // Posición en el documento
            var container_offset_y = container_offset_top - $(window).scrollTop(); // Posición en la ventana
            if(container_offset_y > 260){ return "top"; }
            return "bottom"; 
        },
        content: function () {
            return $(id + '_content .popover-body').html();
        }
    }).on("mouseenter", function () {
        var _this = this;
        $(this).popover("show");
        $(this).siblings(".popover").on("mouseleave", function () {
            $(_this).popover('hide');
        });
    }).on("mouseleave", function () {
        var _this = this;
        setTimeout(function () {
            if (!$(".popover:hover").length) {
                $(_this).popover("hide");
            }
        }, 100);
    }).on("click", function () {
        var _this = this;
        setTimeout(function () {
            $(_this).popover("hide");
        }, 100);
    }).data('bs.popover').tip().attr('data-relocation', data_relocation);
}
//$(id + '_container').css('position', 'relative');

}

enter image description here

如果有人对如何找到解决问题的方法有任何建议,或者只是任何一个在使用Bootstrap模态时遇到相同问题的人,那将不胜感激。

问候

0 个答案:

没有答案