Same Javascript error gets logged over and over again.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Same Javascript error gets logged over and over again.

This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17253
    chrisstiles
    chrisstiles
    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

    Attachments:
    You must be logged in to view attached files.
    #17258
    Ernest Marcinko
    Ernest 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!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17326
    chrisstiles
    chrisstiles
    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 ago by chrisstiles chrisstiles.
    Attachments:
    You must be logged in to view attached files.
    #17343
    Ernest Marcinko
    Ernest 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:

    scope(window).load(function () {

    4. Change that line to:

    scope(window).on('load', function () {

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17359
    chrisstiles
    chrisstiles
    Participant

    Got it, thank you very much!

    #17365
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.