This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Same Javascript error gets logged over and over again.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17253
    chrisstileschrisstiles
    Participant

    As soon as the page loads the following error gets constantly added to the Javascript console. It just keeps counting up into the thousands of errors.

    jquery.js?ver=3.1.1:4 Uncaught TypeError: a.indexOf is not a function
    at r.fn.init.r.fn.load (jquery.js?ver=3.1.1:4)
    at jquery.ajaxsearchpro-noui-isotope.min.js?ver=ZHvU45:27

    #17258
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    Can you please add temporary back-end and FTP details? I will have to check the error directly, as it is impossible to tell based on the error message only.

    I am guessing, that either one of the files got corrupted, or there is something altering/changing the output of the search box, but it could be something else as well.

    Thank you!

    #17326
    chrisstileschrisstiles
    Participant

    Unfortunately I only have it this installed on localhost. I can’t deploy it to my client’s site until it is working.

    I found how to un-minify the JS for this plugin. I’ve attached screenshots showing the line in the plugin’s JS that is causing the error in jQuery. I also replaced the minified version of jQuery I am using to the development version so you can see the specific variables.

    • This reply was modified 6 years, 5 months ago by chrisstileschrisstiles.
    #17343
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    I see the problem now. You are using jQuery version 3+, while the WordPress built in version is 1.12.4 at the moment. The error is caused by a function call that is no longer supported from jQuery 3.
    I strongly recommend sticking with the built in jQuery version, as most plugins are built/scripts are based on that.

    If you want to stick with 3, than that line will have to be modified slightly:
    1. Make sure to change the script version to ‘Non minfied’ here: https://i.imgur.com/eeDQGCV.png
    2. Then open up the wp-content\plugins\ajax-search-pro\js\nomin\asp_wrapper.js file on your server via FTP
    3. Then scroll to line 231, which should be this:

    [html]scope(window).load(function () {[/html]

    4. Change that line to:

    [html]scope(window).on(‘load’, function () {[/html]

    5. Save the file, clear your browser cache and reload the page with CTRL + SHIFT + R.

    This should get rid off the problem, however I am not sure if it causes any further problems.

    #17359
    chrisstileschrisstiles
    Participant

    Got it, thank you very much!

    #17365
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.