0

I do have a problem with my website, and it's basically two javascript files are conflicting, it's not me who coded the files. Therefore, I can't know why the problem occurs.

Uncaught TypeError: jQuery(...).tooltip is not a function
at itemInfo (function.js:105)
at HTMLDocument.<anonymous> (function.js:136)
at j (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.I (jquery.js:2)

Here is the tooltip function:

function itemInfo()
{
jQuery(document).tooltip({
    items: "[data-itemInfo], [title]",
    position: {my: "left+5 center", at: "right center"},
    content: function () {
        var element = jQuery(this);

        if (jQuery(this).prop("tagName").toUpperCase() == 'IFRAME') {
            return;
        }

        if (element.is("[data-itemInfo]")) {
            if (element.parent().find('.info').html() == '') {
                return;
            }
            return element.parent().find('.info').html();
        }

        if (element.is("[title]")) {
            return element.attr("title");
        }
    }
});
}

How I linked the scripts in my page:

    <!-- Vendor -->
    <!--[if lt IE 9]>
    <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
    <![endif]-->
    <!--[if gte IE 9]><!-->
    <script src="{{ basePath() }}/vendor/jquery/jquery.js"></script>
    <!--<![endif]-->
    <script src="{{ basePath() }}/vendor/jquery.appear/jquery.appear.js"></script>
    <script src="{{ basePath() }}/vendor/jquery.easing/jquery.easing.js"></script>
    <script src="{{ basePath() }}/vendor/jquery-cookie/jquery-cookie.js"></script>
    <!--<script src="{{ basePath() }}/vendor/bootstrap/js/bootstrap.js"></script>-->
    <script src="{{ basePath() }}/vendor/common/common.js"></script>
    <script src="{{ basePath() }}/vendor/jquery.validation/jquery.validation.js"></script>
    <script src="{{ basePath() }}/vendor/jquery.stellar/jquery.stellar.js"></script>
    <script src="{{ basePath() }}/vendor/jquery.easy-pie-chart/jquery.easy-pie-chart.js"></script>
    <script src="{{ basePath() }}/vendor/jquery.gmap/jquery.gmap.js"></script>
    <script src="{{ basePath() }}/vendor/jquery.lazyload/jquery.lazyload.js"></script>
    <script src="{{ basePath() }}/vendor/isotope/jquery.isotope.js"></script>
    <script src="{{ basePath() }}/vendor/owl.carousel/owl.carousel.js"></script>
    <script src="{{ basePath() }}/vendor/magnific-popup/jquery.magnific-popup.js"></script>
    <script src="{{ basePath() }}/vendor/vide/vide.js"></script>

     <!-- Scripts -->

        <!--[if lt IE 9]><script type="text/javascript" src="{{ basePath() }}/assets/js/respond.min.js"></script><![endif]-->
        <!--[if lt IE 9]><script type="text/javascript" src="{{ basePath() }}/assets/js/html5shiv.js"></script><![endif]-->
        <script type="text/javascript" src="{{ basePath() }}/js/function.js"></script>
        <script type="text/javascript">
            var ServerTime = new Date( {{ "now"|date("Y, n, j, G, i, s") }} );
            var iTimeStamp = {{ "now"|date("U") }} - Math.round( + new     Date() / 1000 );
            startClockTimer('#idTimerClock');
    </script>

Keep in mind, if I comment the function.js file in my index it works with no problems, but I do need this file to be functioning on my website.

I tried searching for the error, but the answers weren't suitable for my problem.

Thanks in advance =)

Crayon
  • 21
  • 1
  • 11
  • 1
    Perhaps you have 2 versions of jQuery included? – Scott Dec 31 '16 at 01:56
  • 1
    please add a [mcve] to the question for faster troubleshooting. Otherwise, we'll be guessing. - Let's start with the basics: which version of jquery are you using? are you including all the necessary files? (i.e. plugins, etc) – blurfus Dec 31 '16 at 01:57
  • Agree with @ochi. Also try scanning function.js for "tooltip". – Scott Dec 31 '16 at 01:57
  • 2
    The `tooltip` is part of jQuery**UI** and not jquery. Make sure you include all the relevant files of the jquery-ui library. – Dekel Dec 31 '16 at 01:57
  • The reason I didn't add any functions in here, because I didn't know where to look. Sorry =) – Crayon Dec 31 '16 at 02:00
  • #Edit: Added function tooltip from function.js – Crayon Dec 31 '16 at 02:01
  • your code example is not complete; only shows the function (but what about the html? how do you include the file(s) to the HTML? etc) - please read the page about [mcve]s – blurfus Dec 31 '16 at 02:01

0 Answers0